Re: Speeding up 'bulk' delete (and/or seeing what is going on while the delete is being processed) - Mailing list pgsql-novice

From Steve T
Subject Re: Speeding up 'bulk' delete (and/or seeing what is going on while the delete is being processed)
Date
Msg-id 1251396710.3634.362.camel@localhost.localdomain
Whole thread Raw
In response to Re: Speeding up 'bulk' delete (and/or seeing what is going on while the delete is being processed)  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Speeding up 'bulk' delete (and/or seeing what is going on while the delete is being processed)  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-novice
Tom/Alan,
Thanks. 300,000+ rows deleted in under 10 minutes (may have been a lot less - I went to get a coffee, came back and it was done).


Thanks again.


PS Is there a reason that PostgreSql doesn't automatically create the foreign key indexes?


On Thu, 2009-08-27 at 13:17 -0400, Tom Lane wrote:
Alan Hodgson <ahodgson@simkin.ca> writes:
> Do you have other foreign keys into supplierProduct on other tables where 
> the relevant columns aren't indexed? Slow deletes are usually caused by 
> that.

Yeah.  The query plan itself looks perfectly reasonable, so I'm
suspecting the problem is something happening subsequent to the row
deletions --- like foreign key constraint checking.

			regards, tom lane



Steve Tucknott
ReTSol Ltd

DDI:         01323 488548

pgsql-novice by date:

Previous
From: Jignesh Shah
Date:
Subject: Re: Trigger for Truncate event
Next
From: Tom Lane
Date:
Subject: Re: Speeding up 'bulk' delete (and/or seeing what is going on while the delete is being processed)