Re: Query performance going from Oracle to Postgres

Поиск
Список
Период
Сортировка
От David Rowley
Тема Re: Query performance going from Oracle to Postgres
Дата
Msg-id CAApHDvqr31P5fgMot0y=dSsXmHOf9AT7g0E_+LWtJ7Z7dgK0sA@mail.gmail.com
обсуждение исходный текст
Ответ на Query performance going from Oracle to Postgres  ("Dirschel, Steve" <steve.dirschel@thomsonreuters.com>)
Список pgsql-general
On Thu, 7 Sept 2023 at 11:14, Dirschel, Steve
<steve.dirschel@thomsonreuters.com> wrote:
> select count(historyeve0_.HISTORY_EVENT_SID) as col_0_0_ from hist28.history_event_display_timestamp_20230301
historyeve0_where historyeve0_.IS_DELETED=0
 

> history_event_sid      | character varying(32)          |           | not null |

Do you get an Index Only Scan if you use count(*) instead of
count(historyeve0_.HISTORY_EVENT_SID)?

It seems that column is the only one missing from the index and that
might be the only thing that's stopping PostgreSQL using an Index Only
Scan. Perhaps Oracle realises that the column is NOT NULL so can do
count(*) instead of counting the non-nulls from that column.  That may
allow it to Index Only Scan? I'm not versed in reading Oracle plans so
don't know if it's possible to tell.

David



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

Предыдущее
От: Laurenz Albe
Дата:
Сообщение: Re: Query performance going from Oracle to Postgres
Следующее
От: Peter Geoghegan
Дата:
Сообщение: Re: Query performance going from Oracle to Postgres