Date Filter (from field filter) Optimization on Query Builder

Hi,

I have a query that has a date filter, and somehow the query is taking too long to be executed. This did not happen when I use WHERE clause like WHERE date > NOW() - INTERVAL '7 days' without any date filter from Metabase. The tables I queried from, has an index on date column.

Came across this forum and also Github, and found out that this problem has been reported here https://discourse.metabase.com/t/query-builder-date-filter-performance/5932 ,and said that the issue has been raised here https://github.com/metabase/metabase/issues/4043 and has been closed.

My question is, is this issue has been resolved in 0.34.3? Or do I need to update Metabase to a version in which this issue is resolved?

Hi @jodistiara
I think you’re seeing the following issue:
https://github.com/metabase/metabase/issues/11837 - upvote by clicking :+1: on the first post
But without knowing which database you’re querying, it’s hard to know.
There’s a lot of changes in 0.35.2, but nothing specific to indexes.

ah, forgive me for I forgot to mention the important details.

I’m using Postgres DB. does the change in 0.35.2 related to optimizing date filter?
Or maybe could you tell me which version that has this issue #4043 fixed?

@jodistiara
Issue 4043 was added in 0.33.4.
Like I already wrote, there’s a lot of changes in 0.35.2, but nothing specific to indexes.
You’re most likely seeing issue 11837.

1 Like

I see. My problem actually occurs not only when using relative filter but I think fixing the issue related to date filter performance would be a great help. Hence I’ve upvoted.

Thanks for the help!

@jodistiara But your example WHERE date > NOW() - INTERVAL '7 days' is relative, so I guessed you made that as an example of a similar query you were trying to make via the interface?