Re: Slow deleting tables with foreign keys - Mailing list pgsql-performance

From Jeremy Palmer
Subject Re: Slow deleting tables with foreign keys
Date
Msg-id 666FB8D75E95AE42965A0E76A5E5337E06DCC19F61@prdlsmmsg01.ad.linz.govt.nz
Whole thread Raw
In response to Re: Slow deleting tables with foreign keys  (Bob Lunney <bob_lunney@yahoo.com>)
List 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".
Actuallyat 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
theindex stats to see if they are indeed redundant. 

Cheers,
Jeremy
________________________________________
From: Bob Lunney [bob_lunney@yahoo.com]
Sent: Friday, 1 April 2011 3:54 a.m.
To: pgsql-performance@postgresql.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@linz.govt.nz) and
destroythe original message. 
LINZ accepts no responsibility for changes to this email, or for any attachments, after its transmission from LINZ.

Thank you.
______________________________________________________________________________________________________

pgsql-performance by date:

Previous
From: Landreville
Date:
Subject: Re: Calculating 95th percentiles
Next
From: Joseph Shraibman
Date:
Subject: table contraints checks only happen in planner phase