postgres-fdw

postgres_fdw: possible to push data to foreign server for join?

 ̄綄美尐妖づ 提交于 2020-05-26 02:32:26
问题 suppose I have a query like select * from remote_table join local_table using(common_key) where remote_table is a FOREIGN TABLE with postgres_fdw and local_table is a regular table. local_table is small (100 rows) and remote_table is large (millions of rows). It looks like the remote table is pulled in its entirety and joined locally, when it would be more efficient to ship the smaller table to the remote server and join remotely. Is there a way to get postgres_fdw to do that? 回答1: You cannot

postgres_fdw: possible to push data to foreign server for join?

末鹿安然 提交于 2020-05-26 02:31:04
问题 suppose I have a query like select * from remote_table join local_table using(common_key) where remote_table is a FOREIGN TABLE with postgres_fdw and local_table is a regular table. local_table is small (100 rows) and remote_table is large (millions of rows). It looks like the remote table is pulled in its entirety and joined locally, when it would be more efficient to ship the smaller table to the remote server and join remotely. Is there a way to get postgres_fdw to do that? 回答1: You cannot

Postgres_FDW not pushing down WHERE criteria

耗尽温柔 提交于 2020-03-02 02:17:17
问题 I'm working with two PostgreSQL 9.6 databases and am trying to query one of the DB's from the other using postgres_fdw (one is a production backup DB that has the data and the other is a db for doing various analyses). I've come across some odd behavior though where certain types of WHERE clauses in a query aren't being passed to the remote DB but instead are retained in the local DB and used to filter the results received from the remote DB. This is causing the remote DB to try to send way

PostgresSQL Nested Loops - When does the planner decide to use Nested Loop when doing an INNER JOIN?

一个人想着一个人 提交于 2020-01-30 08:14:23
问题 I am running a query with an INNER JOIN where the planner decides to use a Nested Loop. I've figured out that it has do with the WHERE conditions as I have tried writing the query with different WHERE conditions so it returns the same result but does not use a Nested Loop. My question is why has the planner decided to make the different decisions when the queries appear to be identical as they both return the same result? The query runs in 77 secs with the Nested Loop and in 13 sec without,

Parallel append on foreign tables in PostgreSQL 11

最后都变了- 提交于 2020-01-05 13:09:32
问题 Is it possible to achieve parallel append on foreign tables in PostgreSQL 11 (just like on local tables)? Local tables: # select version(); version --------------------------------------------------------------------------------------------------- PostgreSQL 11beta3 on x86_64-pc-linux-gnu, compiled by gcc (Debian 4.9.2-10+deb8u1) 4.9.2, 64-bit (1 row) # create table local_table_1 as select generate_series(1, 1000000); SELECT 1000000 # create table local_table_2 as select generate_series(1,

What am I doing here while updating a table in a remote db using postgres_fdw?

流过昼夜 提交于 2019-12-25 04:04:17
问题 Here is how I am doing it: CREATE EXTENSION IF NOT EXISTS postgres_fdw; DROP SERVER IF EXISTS myserver CASCADE; CREATE SERVER myserver FOREIGN DATA WRAPPER postgres_fdw OPTIONS (host '10.1.1.1', dbname 'mydb', port '5432'); DROP USER MAPPING IF EXISTS FOR user SERVER myserver; CREATE USER MAPPING FOR user SERVER myserver OPTIONS (user 'user', password 'password'); CREATE FOREIGN TABLE IF NOT EXISTS foriegnemployee( id int, name text, is_done boolean ) SERVER myserver OPTIONS (schema_name