duckdb / duckdb_mysql

MIT License
45 stars 10 forks source link

Feature: mysql_query (similar to postgres_query) #35

Closed sertainly closed 5 months ago

sertainly commented 6 months ago

If I understood correctly, there's a functionality in the duckdb_postgres extension named postgres_query that allows to send queries directly to the db/engine and get the result back, without duckdb doing its magic in between.

I'd love to see this for mysql as well, e.g. something like mysql_query(attached_database::VARCHAR, query::VARCHAR).

I could imagine that this may be a low hanging fruit and provide tremendous value (at least to me 😊)

Thanks so much in advance.


Background is that I have some join queries of big tables that run super quick within MySQL, but when setting mysql_debug_show_queries it appears that duckdb does a SELECT x FROM for each of them, which takes rather long in comparison

sertainly commented 6 months ago

@Mytherin Apologies for tagging you directly, I imagine you have a lot on your plate. Could you just give an indication of when / if someone may have the chance to give this a try?

Any answer is fine, but it gives me the chance to deal with it in other ways (e.g. polars).

Thanks so much for your efforts 🦆 .

Mytherin commented 6 months ago

Thanks for the suggestion - I agree this is a good idea. I'll try to have a look at implementing this in the coming weeks.

sertainly commented 6 months ago

Aah that sounds great, thanks a ton 😊

And if you need someone to run a few test queries once it's ready, I'm happy to help.

Mytherin commented 5 months ago

I have a PR up for this here - https://github.com/duckdb/duckdb_mysql/pull/50

Mytherin commented 5 months ago

Implemented now in main

sertainly commented 5 months ago

Thanks so much for implementing 😊 This will really help me. I'll try it out today.