Subject Re: [firebird-support] Re: 1.5.3 SS: need to run long-running queries
Author Dany M
[thread snipped]

Kjell!

I would like to make another suggestion to your problem. This "table
toggling" stuff seems very awkward to me.

Depending on how the new data looks compared to the old data; if it is
quite similar (an update) you could expose the new data to the server
via an external table. If there is a invariant id in the data. Then loop
through the external table, lookup the record in the real table and
apply the changes.

If there should be records removed then there might be a problem with
referential integrity if there are any connections to the large table.
Also if there is no id in the data this approach might be tricky.

If you are concerned with a to-huge transaction, you can put an event in
the end of the procedure and let a small client run the sp again upon
the event received. I think that you could do SELECT with SKIP and FIRST
on an external table without problems even if it is big. Store the
"next" start record in a table.

Just my 5 cents,

HTH,

/Dany