pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andreas Pflug <Andreas.Pflug@web.de>
To: pgsql-performance@postgresql.org
Subject: EXPLAIN not helpful for DELETE
Date: Tue, 04 Feb 2003 16:11:22 +0100
Message-ID: <3E3FD81A.3010307@web.de> (raw)

While executing a lot of INSERTs and DELETEs, I had some performance 
problems which seemed to result from missing foreign key indexes. 
Unfortunately, if doing an EXPLAIN DELETE myTab .... I'm getting only 
the first stage of query plan, i.e. "seq scan on myTab". The database 
accesses behind the scene to check foreign key constraints don't show 
up, so there's no hint that an index might be missing.

Since I got some highly referenced tables, deleting might be a lengthy 
process if any single row leads to a full table scan on dozens of other 
big tables (example: deleting 4000 rows, duration 500 seconds -> 8rows/sec)

But this doesn't seem to be the whole truth. Actually, in the case 
stated above, all referencing tables (about 80) are empty. I performed 
this on a rather small database, imagine what happens if the table has 
1.000.000 rows and referencing tables are filled too!




Message-ID: <3E3FD81A.3010307@web.de>
Permalink:  ../3E3FD81A.3010307@web.de/
Also on:    postgresql.org/message-id/3E3FD81A.3010307@web.de

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: Andreas.Pflug@web.de
  Subject: Re: EXPLAIN not helpful for DELETE
  In-Reply-To: <3E3FD81A.3010307@web.de>
  References: <3E3FD81A.3010307@web.de>

* 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