EnterpriseDB / mysql_fdw

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

Direct MySQL query execution #121

Open trntv opened 7 years ago

trntv commented 7 years ago

Hi! Is there a way to execute queries directly on MySQL server. eg:

DELETE from table where date < CURRENT_DATE;

Because such query will fetch all rows from mysql, then delete them row by row with DELETE from table WHERE id = id. It is a problem when there a lot of rows to delete and for perfomance reasons i need something like

SELECT from mysql_execute_query('DELETE from table WHERE date < CURDATE()')
jmealo commented 7 years ago

This sounds like quals aren't properly being pushed down to MySQL. I have encountered this issue as well. It appears that the maintenance of mysql_fdw consists of getting function signatures to match the new FDW API without implementing the new features or verifying correctness.

ahsanhadi commented 7 years ago

This where clause is not getting pushed down because you have a function in the where clause condition...

jmealo commented 7 years ago

@ahsanhadi: This ticket is requesting a way to send queries directly so that the CURDATE function is executed on the remote side.