Re: Planner avoidance of index only scans for partial indexes - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Planner avoidance of index only scans for partial indexes
Date
Msg-id 25141.1345072858@sss.pgh.pa.us
Whole thread Raw
In response to Planner avoidance of index only scans for partial indexes  (Merlin Moncure <mmoncure@gmail.com>)
List pgsql-hackers
Merlin Moncure <mmoncure@gmail.com> writes:
> If you create an index like this:
> create index on foo(a,b,v) where d = some_constant;
> there is no way to get an IOS on the index: you have to supply a the
> partial index exclusionary value to get the value of the index and
> that fools the IOS chooser because it doesn't see the value in the
> explicit list of index columns.

Yeah, this is a known limitation that we'll probably try to improve
someday.  Per the comment in check_index_only():
   /*    * Check that all needed attributes of the relation are available from the    * index.    *    * XXX this is
overlyconservative for partial indexes, since we will    * consider attributes involved in the index predicate as
requiredeven    * though the predicate won't need to be checked at runtime.  (The same is    * true for attributes used
onlyin index quals, if we are certain that    * the index is not lossy.)  However, it would be quite expensive to    *
determinethat accurately at this point, so for now we take the easy    * way out.    */
 
        regards, tom lane



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [BUGS] BUG #6184: Inconsistencies in log messages
Next
From: Bruce Momjian
Date:
Subject: Re: xlog file naming