From: Alan Hodgson <ahodgson@simkin.ca>
To: pgsql-performance@postgresql.org
Subject: Re: slow delete
Date: Fri, 4 Jul 2008 08:48:19 -0700
Message-ID: <200807040848.19462@hal.medialogik.com> (raw)
In-Reply-To: <31248.217.77.161.17.1215176449.squirrel@sq.gransy.com>
References: <498125.4752.qm@web56401.mail.re3.yahoo.com>
<31248.217.77.161.17.1215176449.squirrel@sq.gransy.com>
On Friday 04 July 2008, tv@fuzzy.cz wrote:
> > My next question is: what is the difference between "select" and
> > "delete"? There is another table that has one foreign key to reference
> > the test (parent) table that I am deleting from and this foreign key
> > does not have an index on it (a 330K row table).
>
Yeah you need to fix that. You're doing 80,000 sequential scans of that
table to do your delete. That's a whole lot of memory access ...
I don't let people here create foreign key relationships without matching
indexes - they always cause problems otherwise.
--
Alan
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: ahodgson@simkin.ca
Subject: Re: slow delete
In-Reply-To: <200807040848.19462@hal.medialogik.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