Re: Slow deleting tables with foreign keys

From: Jeremy Palmer <JPalmer(at)linz(dot)govt(dot)nz>
To: Bob Lunney <bob_lunney(at)yahoo(dot)com>, "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Slow deleting tables with foreign keys
Date: 2011-03-31 19:43:30
Message-ID: 666FB8D75E95AE42965A0E76A5E5337E06DCC19F61@prdlsmmsg01.ad.linz.govt.nz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Hi Bob,

The "table_version.revision" ("revision" is the same) table has a primary key on id because of the PK "revision_pkey". Actually at the moment there are only two rows in the table table_version.revision!

Thanks for the tips about the indexes. I'm still in the development and tuning process, so I will do some analysis of the index stats to see if they are indeed redundant.

Cheers,
Jeremy
________________________________________
From: Bob Lunney [bob_lunney(at)yahoo(dot)com]
Sent: Friday, 1 April 2011 3:54 a.m.
To: pgsql-performance(at)postgresql(dot)org; Jeremy Palmer
Subject: Re: [PERFORM] Slow deleting tables with foreign keys

Jeremy,

Does table_revision have a unique index on id? Also, I doubt these two indexes ever get used:

CREATE INDEX idx_crs_action_expired_created
ON table_version.bde_crs_action_revision
USING btree
(_revision_expired, _revision_created);

CREATE INDEX idx_crs_action_expired_key
ON table_version.bde_crs_action_revision
USING btree
(_revision_expired, audit_id);

Bob Lunney
______________________________________________________________________________________________________

This message contains information, which is confidential and may be subject to legal privilege.
If you are not the intended recipient, you must not peruse, use, disseminate, distribute or copy this message.
If you have received this message in error, please notify us immediately (Phone 0800 665 463 or info(at)linz(dot)govt(dot)nz) and destroy the original message.
LINZ accepts no responsibility for changes to this email, or for any attachments, after its transmission from LINZ.

Thank you.
______________________________________________________________________________________________________

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Joseph Shraibman 2011-04-01 00:41:01 index usage on queries on inherited tables
Previous Message Landreville 2011-03-31 17:30:51 Re: Calculating 95th percentiles