mirror of
https://github.com/kremalicious/umami.git
synced 2025-02-06 01:15:42 +01:00
limit event/session table to 1000 for performance
This commit is contained in:
parent
7ae53e2650
commit
3805a0b431
@ -32,6 +32,7 @@ async function clickhouseQuery(websiteId: string, filters: QueryFilters, pagePar
|
|||||||
|
|
||||||
return pagedQuery(
|
return pagedQuery(
|
||||||
`
|
`
|
||||||
|
with events as (
|
||||||
select
|
select
|
||||||
event_id as id,
|
event_id as id,
|
||||||
website_id as websiteId,
|
website_id as websiteId,
|
||||||
@ -56,6 +57,8 @@ async function clickhouseQuery(websiteId: string, filters: QueryFilters, pagePar
|
|||||||
: ''
|
: ''
|
||||||
}
|
}
|
||||||
order by created_at desc
|
order by created_at desc
|
||||||
|
limit 1000)
|
||||||
|
select * from events
|
||||||
`,
|
`,
|
||||||
{ ...params, query },
|
{ ...params, query },
|
||||||
pageParams,
|
pageParams,
|
||||||
|
@ -29,6 +29,7 @@ async function clickhouseQuery(websiteId: string, filters: QueryFilters, pagePar
|
|||||||
|
|
||||||
return pagedQuery(
|
return pagedQuery(
|
||||||
`
|
`
|
||||||
|
with sessions as (
|
||||||
select
|
select
|
||||||
session_id as id,
|
session_id as id,
|
||||||
website_id as websiteId,
|
website_id as websiteId,
|
||||||
@ -51,6 +52,8 @@ async function clickhouseQuery(websiteId: string, filters: QueryFilters, pagePar
|
|||||||
${filterQuery}
|
${filterQuery}
|
||||||
group by session_id, website_id, hostname, browser, os, device, screen, language, country, subdivision1, city
|
group by session_id, website_id, hostname, browser, os, device, screen, language, country, subdivision1, city
|
||||||
order by lastAt desc
|
order by lastAt desc
|
||||||
|
limit 1000)
|
||||||
|
select * from sessions
|
||||||
`,
|
`,
|
||||||
params,
|
params,
|
||||||
pageParams,
|
pageParams,
|
||||||
|
Loading…
Reference in New Issue
Block a user