Re: Question about optimising (Postgres_)FDW
| От | Tom Lane |
|---|---|
| Тема | Re: Question about optimising (Postgres_)FDW |
| Дата | |
| Msg-id | 6849.1397604332@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Question about optimising (Postgres_)FDW (Hannu Krosing <hannu@2ndQuadrant.com>) |
| Ответы |
Re: Question about optimising (Postgres_)FDW
|
| Список | pgsql-hackers |
Hannu Krosing <hannu@2ndQuadrant.com> writes:
> Is there a way to force it to prefer a plan where the results of (select
> id from onemillion where data > '0.9' limit 100)
> are passed to FDW as a single IN ( = ANY(...)) query and are retrieved
> all at once ?
You could write the query like that:
select * from onemillion_pgfdw where id = any (array(select id from
onemillion where data > '0.9' limit 100));
Or at least you should be able to, except when I try it I get
explain analyze
select * from onemillion_pgfdw where id = any (array(select id from
onemillion where data > '0.9' limit 100));
ERROR: operator does not exist: integer = integer[]
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
CONTEXT: Remote SQL command: EXPLAIN SELECT id, inserted, data FROM public.onemillion WHERE ((id = ANY ((SELECT
null::integer[]))))
so there's something the remote-estimate code is getting wrong here.
(It seems to work without remote_estimate, though.)
regards, tom lane
В списке pgsql-hackers по дате отправления: