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

Constraint exclusion oddity with composite index

From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Constraint exclusion oddity with composite index
Date: 2007-06-01 20:07:31
Message-ID: 46607C83.4050604@commandprompt.com (view raw or flat)
Thread:
Lists: pgsql-hackers
Hello,

Assume the following:

index on: (id, adate)

constraint CHECK(adate > '01-01-2007' AND adate < '04-01-2007');

The planner will not use the index listed above. It does work if we have 
an index on just timehit in addition to the above. (of course)

Is this expected?

Joshua D. Drake

P.S. 8.1.9

-- 

       === The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
Providing the most comprehensive  PostgreSQL solutions since 1997
              http://www.commandprompt.com/

Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate
PostgreSQL Replication: http://www.commandprompt.com/products/


Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2007-06-01 20:46:10
Subject: Re: Command tags in create/drop scripts
Previous:From: Andrew DunstanDate: 2007-06-01 20:05:47
Subject: Re: Command tags in create/drop scripts

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