Re: [HACKERS] An issue in remote query optimization

Поиск
Список
Период
Сортировка
От Abbas Butt
Тема Re: [HACKERS] An issue in remote query optimization
Дата
Msg-id CALtH27dh19zXz0DGV-h89wzWC-MiPwWi0yEQ56kgHYMWeqmh7g@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [HACKERS] An issue in remote query optimization  (Etsuro Fujita <fujita.etsuro@lab.ntt.co.jp>)
Ответы Re: [HACKERS] An issue in remote query optimization  (Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>)
Список pgsql-hackers


On Tue, Jan 31, 2017 at 3:15 AM, Etsuro Fujita <fujita.etsuro@lab.ntt.co.jp> wrote:
On 2017/01/31 19:53, Abbas Butt wrote:
On Tue, Jan 31, 2017 at 2:25 AM, Etsuro Fujita
<fujita.etsuro@lab.ntt.co.jp <mailto:fujita.etsuro@lab.ntt.co.jp>> wrote:
    On 2017/01/31 18:24, Abbas Butt wrote:

        Postgres_fdw optimizes remote queries by pushing down the where
        clause.
        This feature does not work consistently when the query is
        executed from
        within a pl/pgsql function. The optimization works when the function
        executes the query for the first 5 times, and fails afterwards.

        I understand that this is because PostgreSQL starts using
        generic plan
        with pulled up where clause after the 5th invocation hoping that it
        would be faster since we have skiped planning the query on each
        invocation, but in this case this decision is causing the query
        to slow
        down.

        How should we fix this problem?

    ANALYZE for the foreign table doesn't work?

No.

analyze ts.tickets;
WARNING:  skipping "tickets" --- cannot analyze this foreign table
ANALYZE

How the foreign table ts.tickets is defined?

test=# \d ts.tickets
         Foreign table "ts.tickets"
 Column |  Type   | Modifiers | FDW Options
--------+---------+-----------+-------------
 id     | integer | not null  |
Server: mysql_server
FDW Options: (dbname 'msql_test_db', table_name 'tickets')

Its a foreign table, referring to table 'tickets' defined on MySQL.


Best regards,
Etsuro Fujita





--
--
Abbas
Architect
Skype ID: gabbasb
www.enterprisedb.com

Follow us on Twitter

@EnterpriseDB

Visit EnterpriseDB for tutorials, webinars, whitepapers and more

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

Предыдущее
От: Nikita Glukhov
Дата:
Сообщение: Re: [HACKERS] [PATCH]: fix bug in SP-GiST box_ops
Следующее
От: "Daniel Verite"
Дата:
Сообщение: Re: [HACKERS] Improvements in psql hooks for variables