Skip site navigation (1) Skip section navigation (2)

Re: Query-plan for partitioned UPDATE/DELETE slow and swaps vmem compared to SELECT

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: John Papandriopoulos <dr(dot)jpap(at)gmail(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Query-plan for partitioned UPDATE/DELETE slow and swaps vmem compared to SELECT
Date: 2010-12-04 06:20:54
Message-ID: 14012.1291443654@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-performance
John Papandriopoulos <dr(dot)jpap(at)gmail(dot)com> writes:
> I've found that a k-ary table inheritance tree works quite well to
> reduce the O(n) CHECK constraint overhead [1] in the query planner
> when enabling partition constraint exclusion.

Um ... you mean you're creating intermediate child tables for no reason
except to reduce the number of direct descendants of any one table?
That's an utter waste of time, because the first thing the planner will
do with an inheritance tree is flatten it.  Just create *one* parent
table and make all the leaf tables direct children of it.

> My machine swaps wildly when PostgreSQL plans an UPDATE or DELETE.

This is a strong hint that you've got way too many child tables.

			regards, tom lane

In response to

Responses

pgsql-performance by date

Next:From: John PapandriopoulosDate: 2010-12-04 09:20:21
Subject: Re: Query-plan for partitioned UPDATE/DELETE slow and swaps vmem compared to SELECT
Previous:From: John PapandriopoulosDate: 2010-12-03 21:41:36
Subject: Query-plan for partitioned UPDATE/DELETE slow and swaps vmem compared to SELECT

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group