Subject Re: [firebird-support] Proper way for copy data from big table
Author Lester Caine
On 19/06/15 14:20, liviuslivius liviuslivius@...
[firebird-support] wrote:
> SELECT FIRST 1000000 SKIP 0 * FROM SOURCE_TABLE <-we got 1000000 reads -> ok
> SELECT FIRST 1000000 SKIP 1000000 * FROM SOURCE_TABLE <-we got 2000000
> reads -> not ok
> SELECT FIRST 1000000 SKIP 2000000 * FROM SOURCE_TABLE <-we got 3000000
> reads -> not ok worser and worser (slower and slower)

Why would you expect any better when you are reading the data raw, and
it has to count all of the records you want to skip.

You need an index of some sort on the data so that there is at least
some way of finding a record in the middle of the list. A simple
generator based ID number, or a timestamp is all you need to reduce the
time taken to find the starting point of the block you want to use.

Lester Caine - G8HFL
Contact -
L.S.Caine Electronic Services -
EnquirySolve -
Model Engineers Digital Workshop -
Rainbow Digital Media -