add query optimizations from um-13

This commit is contained in:
Brian Cao committed 2022-07-12 22:39:16 -07:00
1 parent 9803d4b5ee
commit 0b7db02103
2 files changed
+16 -12

No files matched your search

+2 -2
View File
@@ -1,4 +1,4 @@
import { getDateQuery, getFilterQuery, rawQuery } from 'lib/queries';
import { getDateQuery, getDateStringQuery, getFilterQuery, rawQuery } from 'lib/queries';
export function getEventMetrics(
website_id,
@@ -14,7 +14,7 @@ export function getEventMetrics(
`
select
event_value x,
${getDateQuery('created_at', unit, timezone)} t,
${getDateStringQuery(getDateQuery('created_at', unit, timezone), unit)} t,
count(*) y
from event
where website_id=$1