adriangb commented on PR #13795: URL: https://github.com/apache/datafusion/pull/13795#issuecomment-2548410787
> 2\. Can you use `coalesce` instead of `case` to substitute in the `true` (might be matching rows)? That should work: ```sql postgres=# create index on stats (coalesce(not row_count = null_count, true), min); CREATE INDEX postgres=# explain select * from stats where coalesce(not row_count = null_count, false) and min > 599; QUERY PLAN ----------------------------------------------------------------------------------------- Index Scan using stats_min_idx on stats (cost=0.57..3637302.07 rows=49999713 width=16) Index Cond: (min > 599) Filter: COALESCE((row_count <> null_count), false) ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org