mirror of
https://github.com/kremalicious/umami.git
synced 2025-02-05 17:05:46 +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(
|
||||
`
|
||||
with events as (
|
||||
select
|
||||
event_id as id,
|
||||
website_id as websiteId,
|
||||
@ -56,6 +57,8 @@ async function clickhouseQuery(websiteId: string, filters: QueryFilters, pagePar
|
||||
: ''
|
||||
}
|
||||
order by created_at desc
|
||||
limit 1000)
|
||||
select * from events
|
||||
`,
|
||||
{ ...params, query },
|
||||
pageParams,
|
||||
|
@ -29,6 +29,7 @@ async function clickhouseQuery(websiteId: string, filters: QueryFilters, pagePar
|
||||
|
||||
return pagedQuery(
|
||||
`
|
||||
with sessions as (
|
||||
select
|
||||
session_id as id,
|
||||
website_id as websiteId,
|
||||
@ -51,6 +52,8 @@ async function clickhouseQuery(websiteId: string, filters: QueryFilters, pagePar
|
||||
${filterQuery}
|
||||
group by session_id, website_id, hostname, browser, os, device, screen, language, country, subdivision1, city
|
||||
order by lastAt desc
|
||||
limit 1000)
|
||||
select * from sessions
|
||||
`,
|
||||
params,
|
||||
pageParams,
|
||||
|
Loading…
Reference in New Issue
Block a user