Re: Delete/update with limit

From: Csaba Nagy <nagy(at)ecircle-ag(dot)com>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: Postgres general mailing list <pgsql-general(at)postgresql(dot)org>
Subject: Re: Delete/update with limit
Date: 2007-07-24 08:28:14
Message-ID: 1185265694.20153.79.camel@coppola.muc.ecircle.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

First of all, thanks for all the suggestions.

> put a SERIAL primary key on the table
Or:
> Maybe add OIDs to the table, and delete based on the OID number?

No, this is not acceptable, it adds overhead to the insertions. Normally
the overhead will be small enough, but on occasions it is noticeable.

> Loop Forever
> DELETE from incoming_table;
> VACUUM incoming_table;
> End Loop;

Not workable either, it still won't assure the table never getting too
big. Once the table is too big, it takes too much to process, and it
gets even bigger for the next time. The whole thing is transient (i.e.
the load will smooth out after a while), but then exactly when it should
work it doesn't... and if you didn't guess, the users want the results
immediately, not next day so we could do the processing at night when we
have virtually no load.

> Use partitioning: don't delete, just drop the partition after a while.

OK, this could work.

It will still be completely different than the code for the other DBs,
but it will work.

Thanks again for all the suggestions,
Csaba.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Henrik Zagerholm 2007-07-24 08:40:16 Slow query but can't see whats wrong
Previous Message Eddy D. Sanchez 2007-07-24 08:19:32 Re: about c# and postgresql