Fix: Add missing SAMPLE BY to query (#4880)

* Fix: Add missing SAMPLE BY to query

* Update lib/plausible/stats/sql/query_builder.ex
This commit is contained in:
Karl-Aksel Puulmann 2024-12-09 10:54:39 +02:00 committed by GitHub
parent 87b65aefd7
commit 0c8fed9570
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -63,6 +63,10 @@ defmodule Plausible.Stats.SQL.QueryBuilder do
group_by: s.session_id
)
on_ee do
sessions_q = Plausible.Stats.Sampling.add_query_hint(sessions_q, query)
end
from(
e in q,
join: sq in subquery(sessions_q),