Re: PostgreSQL optimizer use seq scan instead of pkey index only scan(in queries with postgres_fdw)

Поиск
Список
Период
Сортировка
От Jeff Janes
Тема Re: PostgreSQL optimizer use seq scan instead of pkey index only scan(in queries with postgres_fdw)
Дата
Msg-id CAMkU=1yeu2RL6uEzETDNzoCkXQJAjmuP+mQWGLJ2Kv2ES3avNg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: PostgreSQL optimizer use seq scan instead of pkey index only scan(in queries with postgres_fdw)  (Jeff Janes <jeff.janes@gmail.com>)
Список pgsql-performance
On Mon, May 6, 2019 at 11:53 AM Jeff Janes <jeff.janes@gmail.com> wrote:
On Mon, May 6, 2019 at 11:38 AM Vitaly Baranovsky <barvetalforums@gmail.com> wrote:
Thank you, Jeff!

We'll be looking forward to the next version of Postgres in this case.

As far as I understand, you've answered about sending filtering condition to a foreign server... Could you, please, clarify about another (the first) part of my question? Why the server choose seq scan instead of pk key index only scan for the local table? 

Thank you


Aren't those the same thing?  The foreign server can't use the where clause, if it doesn't get sent. 

Nevermind. When you said local table, I had some tunnel vision and was thinking of the foreign table as viewed from the perspective of the foreign server (to which it is local), not the actual local table.   That too is "fixed" in the same commit to the 12dev branch as the other issue is: 

commit 4be058fe9ec5e630239b656af21fc083371f30ed
Date:   Mon Jan 28 17:54:10 2019 -0500

    In the planner, replace an empty FROM clause with a dummy RTE.
 

My tests are all done with empty, unanalyzed tables as I just took you DDL without inventing my own DML, so may be different than what what you were seeing with your populated tables.

Cheers,

Jeff

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

Предыдущее
От: Vitaly Baranovsky
Дата:
Сообщение: Re: PostgreSQL optimizer use seq scan instead of pkey index only scan(in queries with postgres_fdw)
Следующее
От: Steven Winfield
Дата:
Сообщение: GCC 8.3.0 vs. 9.0.1