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

Re: Planner avoidance of index only scans for partial indexes

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Merlin Moncure <mmoncure(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Planner avoidance of index only scans for partial indexes
Date: 2012-08-15 23:20:58
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Merlin Moncure <mmoncure(at)gmail(dot)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 overly conservative for partial indexes, since we will
     * consider attributes involved in the index predicate as required even
     * though the predicate won't need to be checked at runtime.  (The same is
     * true for attributes used only in index quals, if we are certain that
     * the index is not lossy.)  However, it would be quite expensive to
     * determine that accurately at this point, so for now we take the easy
     * way out.

			regards, tom lane

In response to

pgsql-hackers by date

Next:From: Bruce MomjianDate: 2012-08-16 00:43:25
Subject: Re: xlog file naming
Previous:From: Bruce MomjianDate: 2012-08-15 23:11:42
Subject: Re: [BUGS] BUG #6184: Inconsistencies in log messages

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