Re: Enhancement Request - Mailing list pgsql-admin

From Olivier Gautherot
Subject Re: Enhancement Request
Date
Msg-id CAJ7S9TWTE8ETq3MoTbXE-LFO8_+yAnJORZ9DKE=r-Pb2Ne5EhA@mail.gmail.com
Whole thread Raw
In response to Re: Enhancement Request  (Ron Johnson <ronljohnsonjr@gmail.com>)
Responses Re: Enhancement Request
List pgsql-admin


El jue, 1 feb 2024 2:35, Ron Johnson <ronljohnsonjr@gmail.com> escribió:
On Wed, Jan 31, 2024 at 3:51 PM Hajek, Nick <Nick.Hajek@vishay.com> wrote: 
 [snip]

 Delete from table1 where table1.id in (select table1.id from table1 limit yourlimitnumber)


The IN predicate is only efficient for a very small number of elements, supported by an index.  People (including me) who would find DELETE FROM .. LIMIT TO ... useful want to delete a *lot* of rows (but not all in one giant statement).

Deleting large numbers of rows is a complex task with a lot of hidden issues (index management between other things). Adding a LIMIT paradigm will not simplify it in any way. I remember doing it on tables with over 50 millions rows and had my share of disaster recoveries. Partitions saved my life.

Cheers
Olivier

pgsql-admin by date:

Previous
From: Gabriel Guillem Barceló Soteras
Date:
Subject: Re: Postgres alerting tools?
Next
From: Bernd Lentes
Date:
Subject: RE: Postgres alerting tools?