Re: truncate partitioned table locking - Mailing list pgsql-admin

From Sriram Dandapani
Subject Re: truncate partitioned table locking
Date
Msg-id 6992E470F12A444BB787B5C937B9D4DF04C4CE1B@ca-mail1.cis.local
Whole thread Raw
In response to truncate partitioned table locking  ("Sriram Dandapani" <sdandapani@counterpane.com>)
List pgsql-admin
I have done this before too..except that in this situation, I am trying
to truncate a table whose parent is constantly accessed
(INSERTS,SELECTS). The truncate table command is shown in WAIT state.
Constraint exclusion is set to "on".

The only issue I can see with locking is the fact that the check
constraint criteria (the column on which partitioning is done) is not in
the where clause of the select statements that are issued on the parent
table. (and it is not required too). Wonder if this results in a shared
lock on the child table that I am trying to truncate



-----Original Message-----
From: Benjamin Krajmalnik [mailto:kraj@illumen.com]
Sent: Monday, June 19, 2006 12:46 PM
To: Sriram Dandapani
Cc: pgsql-admin@postgresql.org
Subject: RE: [ADMIN] truncate partitioned table locking

Sriram,

I do this on monthly tables which have about 30 million rows.
Last time I truncated a partition it took anout 2 milliseconds.

-----Original Message-----
From: pgsql-admin-owner@postgresql.org
[mailto:pgsql-admin-owner@postgresql.org] On Behalf Of Sriram Dandapani
Sent: Monday, June 19, 2006 12:41 PM
To: Tom Lane
Cc: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] truncate partitioned table locking

I have a situation where data is constantly inserted and frequently
queried into a master table(and routed appropriately to the partition
based on a non-overlapping check constraint ). I also need to drop the
child partition (say for yesterday's data..the partitioning is done on a
daily basis).

pgsql-admin by date:

Previous
From: "Benjamin Krajmalnik"
Date:
Subject: Re: truncate partitioned table locking
Next
From: "Aaron Bono"
Date:
Subject: Re: truncate partitioned table locking