You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My query joins Postgres tables with one Clickhouse foreign table, and the query plan is not efficient. For example, when my join selects an empty date range on the CH table, e.g. (event_date > 2025-01-01 and event_date < 2024-01-01), Postgres still foreign scans CH thousands of times.
I think the bad query plan is partially caused by the lack of stats, i.e., pg_stats is empty for that Clickhouse foreign table, but no stats is generated after I run ANALYZE on that Clickhouse foreign table.
My questions
Did anyone experience a similar problem? How did you solve it?
Should the Clickhouse FDW support the fetch_size and use_remote_estimate options, similar to the options in postgres_fdw?
Thanks,
George
The text was updated successfully, but these errors were encountered:
Hi,
My query joins Postgres tables with one Clickhouse foreign table, and the query plan is not efficient. For example, when my join selects an empty date range on the CH table, e.g. (event_date > 2025-01-01 and event_date < 2024-01-01), Postgres still foreign scans CH thousands of times.
I think the bad query plan is partially caused by the lack of stats, i.e.,
pg_stats
is empty for that Clickhouse foreign table, but no stats is generated after I runANALYZE
on that Clickhouse foreign table.My questions
fetch_size
anduse_remote_estimate
options, similar to the options in postgres_fdw?Thanks,
George
The text was updated successfully, but these errors were encountered: