Re: constraint exclusion analysis caching - Mailing list pgsql-hackers

From Tom Lane
Subject Re: constraint exclusion analysis caching
Date
Msg-id 13201.1210341704@sss.pgh.pa.us
Whole thread Raw
In response to constraint exclusion analysis caching  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
Andrew Dunstan <andrew@dunslane.net> writes:
> Yesterday a client and I were sad to discover that the overhead of 
> constraint exclusion is apparently O(n) in the number of partitions, and 
> that where we had ~180 partitions each with a simple constraint (check 
> (field = nnn)) the overhead appeared to amount to about 0.25s on some 
> quite performant hardware, which is way too high for our application. 

I would think that any sort of formal partitioning feature would fix the
problem, because the planner would understand directly about
partitioning instead of having to prove the correctness of not scanning
each one of the other 179 partitions.  The existing feature is cool in
the sense of obtaining useful behavior from generalized spare parts,
but it was never designed or expected to give great planning speed
with large numbers of partitions.  TFM points out that constraint
exclusion cannot scale beyond perhaps a hundred partitions ...
        regards, tom lane


pgsql-hackers by date:

Previous
From: Decibel!
Date:
Subject: Re: Table inheritance surprise
Next
From: Gregory Stark
Date:
Subject: Re: constraint exclusion analysis caching