Re: Bad query plan when you add many OR conditions

Поиск
Список
Период
Сортировка
Искать
От
Marco Colli
Тема
Re: Bad query plan when you add many OR conditions
Дата
Msg-id
CAFvCgN40o9v8dJ2=XXXfKHoY7DnXxKC7qHcnK2f69R-gKcBMwg@mail.gmail.com
Ответ на
Список
Дерево обсуждения
Bad query plan when you add many OR conditions Marco Colli <collimarco91@gmail.com>
Re: Bad query plan when you add many OR conditions Justin Pryzby <pryzby@telsasoft.com>
Re: Bad query plan when you add many OR conditions Marco Colli <collimarco91@gmail.com>
Re: Bad query plan when you add many OR conditions Tomas Vondra <tomas.vondra@2ndquadrant.com>
Re: Bad query plan when you add many OR conditions Marco Colli <collimarco91@gmail.com>
Re: Bad query plan when you add many OR conditions Justin Pryzby <pryzby@telsasoft.com>
Re: Bad query plan when you add many OR conditions Marco Colli <collimarco91@gmail.com>
Re: Bad query plan when you add many OR conditions Tom Lane <tgl@sss.pgh.pa.us>
Re: Bad query plan when you add many OR conditions Marco Colli <collimarco91@gmail.com>
Re: Bad query plan when you add many OR conditions Thomas Kellerer <spam_eater@gmx.net>
Re: Bad query plan when you add many OR conditions Jeff Janes <jeff.janes@gmail.com>
Sorry, I didn't notice the SELECT * and I said something stupid... 
However my reasoning should be still valid: I mean, PG could find the few relevant rows (there's a LIMIT 30) using ONLY the index. It has all the information required inside the index! Then it can simply access to that rows on disk... It cannot take ~1 minute to access a few rows on disk (max 30 rows, actual 0 rows).



On Fri, Jan 10, 2020 at 4:18 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
Marco Colli <collimarco91@gmail.com> writes:
> As you can see it is a *index scan* and not an *index only* scan... I don't
> understand why. The index includes all the fields used by the query... so
> an index only scan should be possible.

Huh?  The query is "select * from ...", so it retrieves *all* columns
of the table.

                        regards, tom lane
В списке pgsql-performance по дате отправления
От: Tom Lane
Дата:
От: Jeff Janes
Дата:
FAQ