Re: Bad query plan decision when using multiple column index - postgresql uses only first column then filters

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Bad query plan decision when using multiple column index - postgresql uses only first column then filters
Дата
Msg-id 2419.1579195659@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Bad query plan decision when using multiple column index -postgresql uses only first column then filters  (Michael Lewis <mlewis@entrata.com>)
Список pgsql-performance
Michael Lewis <mlewis@entrata.com> writes:
> Does the behavior change with different values of Ver column?

By and large, indxpath.c will just add all qual clauses that match
an index to the indexscan's conditions --- there's no attempt to
decide that some of them might not be worth it on cost grounds.
So I'd be pretty surprised if altering the Ver constant made any
difference.  My money is on there being some reason why the IN
clause doesn't match the index, perhaps a type mismatch.  Without
seeing the table schema, and the exact query, it's hard to say what
that reason is.  (I'll not insult your intelligence by saying how
I know that the OP didn't just copy-and-paste that query.)

            regards, tom lane



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

Предыдущее
От: Cosmin Prund
Дата:
Сообщение: Re: Bad query plan decision when using multiple column index -postgresql uses only first column then filters
Следующее
От: Cosmin Prund
Дата:
Сообщение: Re: Bad query plan decision when using multiple column index -postgresql uses only first column then filters