Re: Delete query takes exorbitant amount of time - Mailing list pgsql-performance

From Simon Riggs
Subject Re: Delete query takes exorbitant amount of time
Date
Msg-id 1112112087.11750.984.camel@localhost.localdomain
Whole thread Raw
In response to Re: Delete query takes exorbitant amount of time  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Delete query takes exorbitant amount of time
List pgsql-performance
On Tue, 2005-03-29 at 10:31 -0500, Tom Lane wrote:
> Simon Riggs <simon@2ndquadrant.com> writes:
> > If action is NO ACTION or RESTRICT then
> >     we need to SELECT at most 1 row that matches the criteria
> >     which means we can use LIMIT 1
>
> > If action is CASCADE, SET NULL, SET DEFAULT then
> >     we need to UPDATE or DELETE all rows that match the criteria
> >     which means we musnt use LIMIT and need to use FOR UPDATE
>
> Huh?  UPDATE/DELETE don't use FOR UPDATE.  I think you have failed
> to break down the cases sufficiently.  In particular it matters which
> side of the RI constraint you are working from ...

OK... too quick, sorry. I'll hand over to Stephan for a better and more
exhaustive explanation/analysis... but AFAICS we *can* always know the
correct formulation of the query prepare time, whether or not we do
currently.

Best Regards, Simon Riggs




pgsql-performance by date:

Previous
From: Tom Lane
Date:
Subject: Re: Delete query takes exorbitant amount of time
Next
From: Stephan Szabo
Date:
Subject: Re: Delete query takes exorbitant amount of time