Re: Allow DELETE to use ORDER BY and LIMIT/OFFSET

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Allow DELETE to use ORDER BY and LIMIT/OFFSET
Дата
Msg-id CAKFQuwZKMMXE+o7RG_XsPXgexk-R1QL19K8+t+pKnJK5+m40ig@mail.gmail.com
обсуждение исходный текст
Ответ на Allow DELETE to use ORDER BY and LIMIT/OFFSET  (Yugo NAGATA <nagata@sraoss.co.jp>)
Ответы Re: Allow DELETE to use ORDER BY and LIMIT/OFFSET  (Yugo NAGATA <nagata@sraoss.co.jp>)
Список pgsql-hackers
On Thursday, December 16, 2021, Yugo NAGATA <nagata@sraoss.co.jp> wrote:

Also, here seem to be some use cases. For example,
- when you want to delete the specified number of rows from a table
  that doesn't have a primary key and contains tuple duplicated.

Not our problem…use the tools correctly; there is always the hack work-around for the few who didn’t.
 
- when you want to delete the bottom 10 items with bad scores
  (without using rank() window function).

This one doesn’t make sense to me.

- when you want to delete only some of rows because it takes time
  to delete all of them.


This seems potentially compelling though I’d be more concerned about the memory aspects than simply taking a long amount of time.  If this is a problem then maybe discuss it without having a solution-in-hand?  But given the intense I/O cost that would happen spreading this out over time seems acceptable and it should be an infrequent thing to do.  Expecting users to plan and execute some custom code for their specific need seems reasonable.

So even if Tom’s technical concerns aren’t enough working on this based upon these uses cases doesn’t seem of high enough benefit.

David J.

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Dilip Kumar
Дата:
Сообщение: Re: Add sub-transaction overflow status in pg_stat_activity
Следующее
От: Tom Lane
Дата:
Сообщение: Re: WIP: WAL prefetch (another approach)