EnterpriseDB / mysql_fdw

PostgreSQL foreign data wrapper for MySQL
Other
535 stars 162 forks source link

PostgresSQL join with 2 mysql tables by foreign data wrapper #72

Open Borkache opened 9 years ago

Borkache commented 9 years ago

I have 4 servers 2 are postgres and 2 others are MySql, had trouble with mysql_fdw , tried to join my postgres table with foreign postgres then mysql's one - everything is fine, query's execution time is near 0.05s - So everything is good. Right after that , I've added JOIN to another one mysql table on other Mysql Server through another mysql_fwd server, and this time execution time became about 150-200s, that's not acceptable. Does anyone find a solution for that or maybe some tricks. Thanks!

ahsanhadi commented 8 years ago

The mysql fdw doesn't push down the join clause to the foreign server. The joins get performed on the source PG database. Can you share your query explain plan generated with explain verbose query so we can see if not pushing down the join is causing the query to take to much time.

ahsanhadi commented 8 years ago

Waiting for test-case.