Re: optimizing postgres

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: lawpoop(at)gmail(dot)com
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: optimizing postgres
Date: 2007-07-13 01:39:07
Message-ID: 7825.1184290747@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

lawpoop(at)gmail(dot)com writes:
> It turned out he was right for our current set up. When I needed to
> empty the project table to re-parse data, doing a cascading delete
> could take up to 10 minutes!

You mean ON CASCADE DELETE foreign keys? Usually the reason that's
slow is you forgot to put an index on the referencing column. PG
doesn't force you to have such an index, but unless the referenced
table is nearly static you'll want one.

I too am fairly suspicious of the N-tables-are-faster-than-another-
key-column mindset, but you'd need to do some actual experimentation
(with correctly optimized table definitions ;-)) to be sure.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2007-07-13 01:43:40 Re: How to pg_dumpall without root password
Previous Message Stephen Frost 2007-07-13 01:29:47 Re: question on scan of clustered index