Re: Using ctid column changes plan drastically

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thomas Kellerer <spam_eater@xxxxxxx> 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

-- 
Sent via pgsql-performance mailing list (pgsql-performance@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance


[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux