https://www.growthbook.io/ logo
#announcements
Title
# announcements
h

helpful-carpenter-3208

08/29/2022, 8:00 PM
Hi~ we noticed that in the generated SQL for experiment. it’s running slow for large tables. as you see the subquery didn’t have a timestamp filter on it. so is there a way that we can config on GB side to just add that timestamp filter on? or is it should be part of the generated query.
Copy code
SELECT
    user_id as user_id,
    1 as value,
    m.timestamp as conversion_start,
    m.timestamp as conversion_end
  FROM
    (
      SELECT
        distinct dec_user_id as user_id,
        created_at as timestamp
      from
        events.track_all
      where
        event_category = 'Foo'
        and event_action = 'Bar'
        and event_label = 'Action'
        -- Expect here has timestamp filter to speedup this subquery
        -- and timestamp >= toDateTime('2022-08-24 00:00:00')
    ) m
  WHERE
    m.timestamp >= toDateTime('2022-08-24 00:00:00')
f

future-teacher-7046

08/29/2022, 8:02 PM
🙌 1
h

helpful-carpenter-3208

08/29/2022, 9:03 PM
That’s what I’m expected! Thanks for this
18 Views