Re: DELETE with LIMIT (or my first hack)

Поиск
Список
Период
Сортировка
От Marko Tiikkaja
Тема Re: DELETE with LIMIT (or my first hack)
Дата
Msg-id 4CF554CC.9040708@cs.helsinki.fi
обсуждение исходный текст
Ответ на Re: DELETE with LIMIT (or my first hack)  (Marko Tiikkaja <marko.tiikkaja@cs.helsinki.fi>)
Ответы Re: DELETE with LIMIT (or my first hack)  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
While reading this thread, I thought of two things I think we could do 
if this feature was implemented:
 1. Sort large UPDATE/DELETEs so it is done in heap order

This is actually a TODO item.  I imagine it would be possible to do 
something like:

DELETE FROM foo USING (...) ORDER BY ctid;

with this patch to help this case.
 2. Reducing deadlocks in big UPDATE/DELETEs

One problem that sometimes occurs when doing multiple multi-row UPDATEs 
or DELETEs concurrently is that the transactions end up working on the 
same rows, but in a different order.  One could use an ORDER BY clause 
to make sure the transactions don't deadlock.

Thoughts?


Regards,
Marko Tiikkaja


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

Предыдущее
От: Jeff Davis
Дата:
Сообщение: Re: DELETE with LIMIT (or my first hack)
Следующее
От: Tom Lane
Дата:
Сообщение: KNNGIST next step: adjusting indexAM API