Re: Delete performance again

From: Віталій Тимчишин <tivv00(at)gmail(dot)com>
To:
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Delete performance again
Date: 2008-10-10 08:24:08
Message-ID: 331e40660810100124h7aef87cap4cabbf15848b9380@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

BTW: Have just tried "clean" (without any foreign keys constraints)
peformance of
"delete from tbl where field not in (select)"
vs
"create temporary table tmp(id) as select distinct field from tbl; delete
from tmp where id in (select); delete from tbl where field in (select id
from tmp)".
both tbl and select are huge.
tbl cardinality is ~5 million, select is ~1 milliion. Number of records to
delete is small.
select is simply "select id from table2".

First (simple) one could not do in a night, second did in few seconds.

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Kiran Mukhyala 2008-10-10 17:48:09 Re: inaccurate stats on large tables
Previous Message Greg Smith 2008-10-10 08:22:35 Re: "Mysterious" issues with newly installed 8.3