Re: Complex filters -> Bad row estimates -> bad query plan

Поиск
Список
Период
Сортировка
От Michael Lewis
Тема Re: Complex filters -> Bad row estimates -> bad query plan
Дата
Msg-id CAHOFxGpnAX7x0s7sQ-mkNQVA3VQ7+65nOOFtU5mOLy_tk=k1Jg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Complex filters -> Bad row estimates -> bad query plan  (Mathieu Fenniak <mathieu.fenniak@replicon.com>)
Список pgsql-general
-- I'm thinking the OFFSET 0 create an optimization barrier that prevents the planner from collapsing that sub-query into the top query, and enforces ordering in the query?

That's my understanding. I think it is an optimizer hint by another name. I used to put things in a CTE (which is always materialized until v12, which will change it to inlined unless keyword MATERIALIZED is included) or I would create a temp table if the dataset is expected to contain many rows such that I can do ANALYZE pg_temp.table_table; so the optimizer has stats to make good decisions.

Note- Replying to messages with a full quote of the conversation below your comment (aka top-posting) is discouraged on these mailing lists. Please quote the portion you are responding to and that's it.

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

Предыдущее
От: DiasCosta
Дата:
Сообщение: Re: Importing from CSV, auto creating table?
Следующее
От: Ron
Дата:
Сообщение: Re: Importing from CSV, auto creating table?