Re: BUG #12763: Planner refuses to do index-only-scan on partial indexes despite having all the required data

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #12763: Planner refuses to do index-only-scan on partial indexes despite having all the required data
Дата
Msg-id 13813.1423691859@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #12763: Planner refuses to do index-only-scan on partial indexes despite having all the required data  (toruvinn@lain.pl)
Список pgsql-bugs
toruvinn@lain.pl writes:
> johto told me on irc it may be worth reporting it here - thanks!

Not really.  See 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.
     */

This is the same reason why expression indexes are difficult to use in
index-only scans: if the query refers to f(x), the information available
to check_index_only() says that the index must be able to return the value
of "x", not "f(x)".  It'd be nice to improve, but the only obvious ways to
do that would result in entirely unacceptable hits to planning speed.

            regards, tom lane

В списке pgsql-bugs по дате отправления:

Предыдущее
От: toruvinn@lain.pl
Дата:
Сообщение: BUG #12763: Planner refuses to do index-only-scan on partial indexes despite having all the required data
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: BUG #12755: pg_upgrage creates potentially dangerous delete_old_cluster.bat