Closed pietrobaricco closed 2 years ago
I observed the same thing. It seems like this happens for a table with a lot of rows. I have a table with >700k rows, and it takes around 3 seconds to run this simple query: select * from xxx limit 1
while doing the same on a smaller table with >10k rows only takes 500ms.
Hi @prankymat and @pietrobaricco,
We have now added LIMIT OFFSET pushdown support along with other features for performance benefit. Can you please re-check at your end if that is useful for you? Kindly share your feedback.
Hi, I tried today with a fresh build and indeed, the situation is now much better. Thank you!
Glad to hear that the pushdown features are helpful at your end.
We will close the issue from our end. Feel free to open a new issue if you face any further issues on this.
Closing per comments above.
I understand that limit and offset are not pushed down to mysql, so using tables larger than a few thousand rows is impractical and requires the use of matviews on the postgres side to achieve reasonable performance. But what puzzles me is that I have a table with ~20k rows, let's call it users
A trivial query such as
select id from users
returns the whole resultset in less than 500ms when executed directly from mysql, yet it takes 10 seconds when using a fdw.
I'm using postgres 13 and google cloud sql with its proxy, same connection parameters for both fdw and mysql client.