Subject Re: Too slow to insert into my table having 14 million records
Author karolbieniaszewski
--- In firebird-support@yahoogroups.com, "crizaldogordo" <crizaldogordo@...> wrote:
>
> Hello ExpertS,
> How i can resolve my problem of inserting record to my table having 14 million of records.
>
> Here are the details.
> Firebird Server : 1.5.x
> OdbC : 1.2 ver
> Size of Database : 3.7 GB
>
> Windows Xp Pro 32bit
> Intel Dual Core 1.6Ghz
> 2GB DDR3 RAM
> 5400 rpm SATA drive
>
> The table that taking time to insert has
> 3 Primary key's and 3 Index and 12 FIELDS
>
> the stored procedure command to insert to the table is :
>
> INSERT INTO targetTable(field1,field2,field3)
> SELECT field1,field2,field3 FROM sourcetable
>
> if i run the procedure , it takes time to insert to mytable, but if i
> create a empty table, it runs fast.
>
> thanks in advance.
>

try this
1. run
select count(*) from sourcetable
how long?
select count(*) from targetTable
how long?

do the same once again
select count(*) from sourcetable
how long?
select count(*) from targetTable
how long?

if time of first run and time of second have big difference
then your garbage collector not process record versions

do also gstat -h
how this look like?
try gfix -sweep

run your inserting statement - now run fast?
how look your table definition and indexes?
may be disabling indexes at insert time is good way

Karol Bieniaszewski