-
Notifications
You must be signed in to change notification settings - Fork 6.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
when using Engine=MySQL for table or database - can i hint ClickHouse to pass WHERE condition to underlying MySQL? #63068
Comments
From the docs:
So, even though it compiles the list before the main query, the IN operation is executed on ClickHouse, which means it needs to read the content table. Below is the execution difference between using
|
thanks @pmusa ; so, basically, for the type of query i'm trying to execute - there's no way to push down filtering to MySQL level? thx! |
I don't think so. Why would you want to do it anyway? Then, the computation would be all done by MySQL, so just run the query on MySQL. |
@pmusa : here's our use case: over time ClickHouse became central hub for calculating any type of statistics for us. some of the data is replicated to it, while other data 'mounted' via MySQL database engine from remote servers. this gives us ability to use joins across otherwise disconnected systems. in this particular case data from a ticketing system is not replicated, but 'mounted' instead. the particular query i'm trying to execute, without ability to push down IN ( list of values ) to MySQL would be very inefficient. oh well - now i have a better idea about the inner workings, maybe we'll have to consider MaterializedMySQL or gather this particular stats at the source rather than via ClickHouse. thanks! |
let's say i have a MySQL database 'mounted' to ClickHouse 24.3.2 via:
i've noticed that most of more complex queries lead to ClickHouse reading the whole table from MySQL.
example query:
while i don't expect ClickHouse to pass the whole query to MySQL - i'd love to hint ClickHouse that it should compile list of ids from the subquery and then pass it to MySQL for the outer query instead of loading whole content table from MySQL and only then doing the filtering.
thank you!
The text was updated successfully, but these errors were encountered: