Re: allow LIMIT in UPDATE and DELETE

Поиск
Список
Период
Сортировка
От Csaba Nagy
Тема Re: allow LIMIT in UPDATE and DELETE
Дата
Msg-id 1148045197.17461.377.camel@coppola.muc.ecircle.de
обсуждение исходный текст
Ответ на Re: allow LIMIT in UPDATE and DELETE  (Csaba Nagy <nagy@ecircle-ag.com>)
Список pgsql-general
> That would spare a HashAggregate and an index scan. The index scan would
> very likely not be a problem, as the same index entries are visited in
> the subquery and likely are cached, and the HashAggregate should be also
> fast for the max 1000 rows it has to handle, but they are still
> completely unnecessary for my purpose, so I still think the LIMIT on
> DELETE and UPDATE would make perfect sense.

Oh, it just occured to me: the subquery is using a different index than
the outer loop, so we can forget about caching. Considering that the
outer loop uses an index 10x bigger than the subquery, and that means
~50million entries, and the typical situation where this would be used
mostly selects 1000 rows indeed, the LIMIT on DELETE for this case would
mean for sure ~ 50% speedup.

Cheers,
Csaba.



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

Предыдущее
От: Csaba Nagy
Дата:
Сообщение: Re: allow LIMIT in UPDATE and DELETE
Следующее
От: Tom Lane
Дата:
Сообщение: Re: allow LIMIT in UPDATE and DELETE