Re: Using ctid column changes plan drastically

Поиск
Список
Период
Сортировка
От Kevin Grittner
Тема Re: Using ctid column changes plan drastically
Дата
Msg-id 501916240200002500049322@gw.wicourts.gov
обсуждение исходный текст
Ответ на Re: Using ctid column changes plan drastically  (Thomas Kellerer <spam_eater@gmx.net>)
Список pgsql-performance
Thomas Kellerer <spam_eater@gmx.net> wrote:

> I finally found a solution that runs fine:
>
> DELETE FROM dupes a
> WHERE EXISTS (SELECT 1
>                FROM  dupes b
>                WHERE b.first_name = a.first_name
>                  AND b.last_name = a.last_name
>                  AND b.ctid > a.ctid);

How does performance for that compare to?:

CREATE TABLE nodupes AS
  SELECT DISTINCT ON (last_name, first_name) * FROM dupes
  ORDER BY last_name, first_name, ctid;

-Kevin

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

Предыдущее
От: "Hugo "
Дата:
Сообщение: Re: pg_dump and thousands of schemas
Следующее
От: Russell Keane
Дата:
Сообщение: query using incorrect index