Hi, thanks for the great product. I have a large PostgreSQL table partitioned by month. When using a field filter with the date, Metabase generates the following SQL:
... where CAST("public"."table"."event_date" AS date) between $1 and $2
Unfortunately, this SQL statement scans all partitions (try EXPLAIN ANALYZE) and thus is very slow. If you remove the CAST, PostgreSQL version 11 will be able to optimize it to access only the relevant partition:
... where "public"."table"."event_date" between '2019-06-01' and '2019-06-30 23:59:59'
Can you please remove the CAST? Thanks again and keep up the great work!