Subject Re: [firebird-support] Maintenance of temporary tables
Author Helen Borrie
At 03:31 PM 22/06/2004 +0200, you wrote:
>Hello,
>
>I'm using a fake temporary table to hold lists of IDs. It has two fields :
>LISTID and ID.
>The common scenario is that I insert records in this table at the start of a
>tansaction and delete them all when committing, so that the table always
>"looks" empty.
>
>I expect to insert and delete at most 300000 rows a day (10 consecutive days
>per month).
>
>What kind of issues should I expect and how should I prevent them ?

Because of the compound index, it's possible the index will become very
inefficient if you have a lot of duplications in one or two of index key
columns. So that's a "plus" for deleting as you go.


>Some ideas ...
>
>Should I issue a "Select count(*)" every once in a while during the day to
>take care of GC, or should I leave that up the nightly SWEEP ?

If you're sweeping nightly anyway, forget about trying to force GC - just
make sure that any transactions on the table are hard-committed.

>Should I delete rows during production at all, or instead leave that up to a
>nightly bulk_deletes_task ? (The table has a unique compound index, so I
>think it shouldn't introduce to much performance penalty)

Depends on the index. If you notice things tending to slow down, you're
probably better to delete as you go. If the performance keeps up, I'd go
for the nightly bulk delete with a hard commit, and follow it up with a sweep.

/heLen