From 1955166bdf7f7c23f0898226e938c21c9f16f742 Mon Sep 17 00:00:00 2001 From: Mike Cao Date: Wed, 14 Feb 2024 15:13:53 -0800 Subject: [PATCH] Bump query limit to 500. --- .../settings/websites/[websiteId]/WebsiteTransferForm.tsx | 3 --- src/queries/analytics/eventData/getEventDataEvents.ts | 6 +++--- src/queries/analytics/eventData/getEventDataFields.ts | 4 ++-- src/queries/analytics/getValues.ts | 4 ++-- src/queries/analytics/pageviews/getPageviewMetrics.ts | 4 ++-- src/queries/analytics/sessions/getSessionMetrics.ts | 4 ++-- 6 files changed, 11 insertions(+), 14 deletions(-) diff --git a/src/app/(main)/settings/websites/[websiteId]/WebsiteTransferForm.tsx b/src/app/(main)/settings/websites/[websiteId]/WebsiteTransferForm.tsx index d5ded108..db46c212 100644 --- a/src/app/(main)/settings/websites/[websiteId]/WebsiteTransferForm.tsx +++ b/src/app/(main)/settings/websites/[websiteId]/WebsiteTransferForm.tsx @@ -9,7 +9,6 @@ import { Dropdown, Item, Flexbox, - useToasts, } from 'react-basics'; import { useApi, useLogin, useMessages, useTeams } from 'components/hooks'; import { WebsiteContext } from 'app/(main)/websites/[websiteId]/WebsiteProvider'; @@ -34,7 +33,6 @@ export function WebsiteTransferForm({ }); const { result, query } = useTeams(user.id); const isTeamWebsite = !!website?.teamId; - const { showToast } = useToasts(); const handleSubmit = async () => { mutate( @@ -44,7 +42,6 @@ export function WebsiteTransferForm({ }, { onSuccess: async () => { - showToast({ message: formatMessage(messages.saved), variant: 'success' }); onSave?.(); onClose?.(); }, diff --git a/src/queries/analytics/eventData/getEventDataEvents.ts b/src/queries/analytics/eventData/getEventDataEvents.ts index 683d9558..3eeb3702 100644 --- a/src/queries/analytics/eventData/getEventDataEvents.ts +++ b/src/queries/analytics/eventData/getEventDataEvents.ts @@ -53,7 +53,7 @@ async function relationalQuery(websiteId: string, filters: QueryFilters) { and event_data.created_at between {{startDate}} and {{endDate}} group by website_event.event_name, event_data.event_key, event_data.data_type order by 1 asc, 2 asc - limit 100 + limit 500 `, params, ); @@ -82,7 +82,7 @@ async function clickhouseQuery( and event_name = {event:String} group by event_key, data_type, string_value, event_name order by 1 asc, 2 asc, 3 asc, 4 desc - limit 100 + limit 500 `, params, ).then(a => { @@ -110,7 +110,7 @@ async function clickhouseQuery( and created_at between {startDate:DateTime64} and {endDate:DateTime64} group by event_key, data_type, event_name order by 1 asc, 2 asc - limit 100 + limit 500 `, params, ).then(a => { diff --git a/src/queries/analytics/eventData/getEventDataFields.ts b/src/queries/analytics/eventData/getEventDataFields.ts index df5a8874..293aed24 100644 --- a/src/queries/analytics/eventData/getEventDataFields.ts +++ b/src/queries/analytics/eventData/getEventDataFields.ts @@ -31,7 +31,7 @@ async function relationalQuery(websiteId: string, filters: QueryFilters & { fiel ${filterQuery} group by event_key, data_type, string_value order by 3 desc, 2 desc, 1 asc - limit 100 + limit 500 `, params, ); @@ -59,7 +59,7 @@ async function clickhouseQuery( ${filterQuery} group by event_key, data_type, string_value order by 3 desc, 2 desc, 1 asc - limit 100 + limit 500 `, params, ).then(a => { diff --git a/src/queries/analytics/getValues.ts b/src/queries/analytics/getValues.ts index c270727e..44955423 100644 --- a/src/queries/analytics/getValues.ts +++ b/src/queries/analytics/getValues.ts @@ -22,7 +22,7 @@ async function relationalQuery(websiteId: string, column: string, startDate: Dat on session.session_id = website_event.session_id where website_event.website_id = {{websiteId::uuid}} and website_event.created_at between {{startDate}} and {{endDate}} - limit 100 + limit 500 `, { websiteId, @@ -41,7 +41,7 @@ async function clickhouseQuery(websiteId: string, column: string, startDate: Dat from website_event where website_id = {websiteId:UUID} and created_at between {startDate:DateTime64} and {endDate:DateTime64} - limit 100 + limit 500 `, { websiteId, diff --git a/src/queries/analytics/pageviews/getPageviewMetrics.ts b/src/queries/analytics/pageviews/getPageviewMetrics.ts index b7aef81c..0bf931fd 100644 --- a/src/queries/analytics/pageviews/getPageviewMetrics.ts +++ b/src/queries/analytics/pageviews/getPageviewMetrics.ts @@ -17,7 +17,7 @@ async function relationalQuery( websiteId: string, column: string, filters: QueryFilters, - limit: number = 100, + limit: number = 500, ) { const { rawQuery, parseFilters } = prisma; const { filterQuery, joinSession, params } = await parseFilters( @@ -57,7 +57,7 @@ async function clickhouseQuery( websiteId: string, column: string, filters: QueryFilters, - limit: number = 100, + limit: number = 500, ): Promise<{ x: string; y: number }[]> { const { rawQuery, parseFilters } = clickhouse; const { filterQuery, params } = await parseFilters(websiteId, { diff --git a/src/queries/analytics/sessions/getSessionMetrics.ts b/src/queries/analytics/sessions/getSessionMetrics.ts index c6877a3f..be414b1c 100644 --- a/src/queries/analytics/sessions/getSessionMetrics.ts +++ b/src/queries/analytics/sessions/getSessionMetrics.ts @@ -17,7 +17,7 @@ async function relationalQuery( websiteId: string, column: string, filters: QueryFilters, - limit: number = 100, + limit: number = 500, ) { const { parseFilters, rawQuery } = prisma; const { filterQuery, joinSession, params } = await parseFilters( @@ -56,7 +56,7 @@ async function clickhouseQuery( websiteId: string, column: string, filters: QueryFilters, - limit: number = 100, + limit: number = 500, ): Promise<{ x: string; y: number }[]> { const { parseFilters, rawQuery } = clickhouse; const { filterQuery, params } = await parseFilters(websiteId, {