pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Віталій Тимчишин <tivv00@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Delete performance again
Date: Fri, 10 Oct 2008 11:24:08 +0300
Message-ID: <331e40660810100124h7aef87cap4cabbf15848b9380@mail.gmail.com> (raw)
In-Reply-To: <331e40660810090554n4633de19gc2ee5fd4aa85457c@mail.gmail.com>
References: <331e40660810020242u2f0f5de2qe146312e448a7df4@mail.gmail.com>
	<23315.1222949660@sss.pgh.pa.us>
	<331e40660810020821w4c4f212br3943df435589f731@mail.gmail.com>
	<CA896D7906BF224F8A6D74A1B7E54AB3039E8BEF@JENMAIL01.ad.intershop.net>
	<331e40660810090554n4633de19gc2ee5fd4aa85457c@mail.gmail.com>

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.

view thread (6+ messages)

Message-ID: <331e40660810100124h7aef87cap4cabbf15848b9380@mail.gmail.com>
Permalink:  ../331e40660810100124h7aef87cap4cabbf15848b9380@mail.gmail.com/
Also on:    postgresql.org/message-id/331e40660810100124h7aef87cap4cabbf15848b9380@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tivv00@gmail.com
  Subject: Re: Delete performance again
  In-Reply-To: <331e40660810100124h7aef87cap4cabbf15848b9380@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox