Re: Filtering on an enum field in a foreign table

From: Nikolay Samokhvalov <samokhvalov(at)gmail(dot)com>
To: Vladimir Ryabtsev <greatvovan(at)gmail(dot)com>
Cc: pgsql-performance(at)lists(dot)postgresql(dot)org
Subject: Re: Filtering on an enum field in a foreign table
Date: 2019-07-17 00:45:17
Message-ID: CANNMO++GSKq52FQhZyVMKoqgRfZfoz1DaC04n+dXfXiE_voi+Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Hi,

On Tue, Jul 16, 2019 at 4:00 PM Vladimir Ryabtsev <greatvovan(at)gmail(dot)com>
wrote:

> I am querying a remote server through a foreign table definition.
>
> CREATE TABLE example (id integer, product product_enum, status status_enum)
>
...

> When I am querying the foreign table on enum predicate like
>
> select * from example where product = 'a' and status = 'active'
>
> I see that filtering happens on my server which can be seen in the plan
> and can be felt from the query performance (indices are not used of course).
>

What Postgres version do you use?

Any changes in plans if you collect stats on the FDW table ("analyze
example;")?

Have you considered changing the option "use_remote_estimate" (see
https://www.postgresql.org/docs/current/postgres-fdw.html#id-1.11.7.42.10)?

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Vladimir Ryabtsev 2019-07-17 01:06:27 Re: Filtering on an enum field in a foreign table
Previous Message Vladimir Ryabtsev 2019-07-16 23:00:10 Filtering on an enum field in a foreign table