Re: Postgres 11 chooses seq scan instead of index-only scan

Поиск
Список
Период
Сортировка
От Don Seiler
Тема Re: Postgres 11 chooses seq scan instead of index-only scan
Дата
Msg-id CAHJZqBBK_dMM6FAxb59nEaWNn_fk-i9_em4kQ6svFwje+K4DXw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Postgres 11 chooses seq scan instead of index-only scan  (twoflower <standa.kurik@gmail.com>)
Список pgsql-general
On Thu, Jan 24, 2019 at 9:01 AM twoflower <standa.kurik@gmail.com> wrote:
Yes! That was it, after running VACUUM TABLE history_translation, the query is now executed using index-only scan.

I was under the impression that ANALYZE TABLE history_translation is enough, but it is not.

Only a VACUUM will update the visibility map. https://www.postgresql.org/docs/current/storage-vm.html

I used to think the same, that ANALYZE was enough, coming from an Oracle background. I learned later that the visibility map isn't just used to determine what to vacuum, but it is used by the optimizer/planner when evaluating execution plans.
 
--
Don Seiler
www.seiler.us

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

Предыдущее
От: Geoff Winkless
Дата:
Сообщение: Re: Casting Integer to Boolean in assignment
Следующее
От: Ron
Дата:
Сообщение: Re: [pgbackrest] Expiring the last backup?