Re: query plan ignoring check constraints - Mailing list pgsql-hackers

From Josh Berkus
Subject Re: query plan ignoring check constraints
Date
Msg-id 200506201035.24406.josh@agliodbs.com
Whole thread Raw
In response to query plan ignoring check constraints  (Rohit Gaddi <rohitgaddi@yahoo.co.in>)
Responses Re: query plan ignoring check constraints
Re: query plan ignoring check constraints
List pgsql-hackers
Rohit,

> Now, when I do a select on the basetable with a range of ids, it looks up
> each subtable that inherits from the base table and using an indexed scan
> searches for values in the range. It does it even for subtables whose check
> constraint completely rules out the possibility of it containing any such
> row . Should not check constraint act as the first filter? The index should
> ideally be scanned only when the check constraint is passed by the search
> criteria but surprisingly it did not happen. The explain analyze showed
> cost for index scans of subtables that cannot contain rows matching the
> search criteria.

This is called "range partitioning".   We're working on it.  You're welcome to 
join the Bizgres project where most of the discussion on this feature takes 
place:
www.bizgres.org
http://pgfoundry.org/mail/?group_id=1000107

-- 
Josh Berkus
Aglio Database Solutions
San Francisco


pgsql-hackers by date:

Previous
From: Rohit Gaddi
Date:
Subject: query plan ignoring check constraints
Next
From: Robert Treat
Date:
Subject: Re: buildfarm notifications