Remove ORDER BY min(session.start) (#3771)

This adds a needless performance overhead. Note that all queries already
sort by the _name_ of the breakdown value besides the session start.
exclude-in-api
Karl-Aksel Puulmann 3 years ago committed by GitHub
parent 494ffbd622
commit d1fe184cb7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -201,7 +201,7 @@ defmodule Plausible.Stats.Breakdown do
defp breakdown_sessions(site, query, property, metrics, pagination) do
from(s in query_sessions(site, query),
order_by: [desc: fragment("uniq(?)", s.user_id), asc: fragment("min(?)", s.start)],
order_by: [desc: fragment("uniq(?)", s.user_id)],
select: %{}
)
|> filter_converted_sessions(site, query)

@ -1,3 +1,3 @@
name,version,visitors
Firefox,120,2
(not set),(not set),2
Firefox,120,2

1 name version visitors
Firefox 120 2
2 (not set) (not set) 2
3 Firefox 120 2

@ -1,3 +1,3 @@
name,visitors
Firefox,2
(not set),2
Firefox,2

1 name visitors
Firefox 2
2 (not set) 2
3 Firefox 2

@ -1,4 +1,4 @@
name,version,visitors
Firefox,120,2
(not set),(not set),2
Firefox,120,2
FirefoxNoVersion,(not set),1

1 name version visitors
Firefox 120 2
2 (not set) (not set) 2
3 Firefox 120 2
4 FirefoxNoVersion (not set) 1

@ -1,4 +1,4 @@
name,visitors
Firefox,2
(not set),2
Firefox,2
FirefoxNoVersion,1

1 name visitors
Firefox 2
2 (not set) 2
3 Firefox 2
4 FirefoxNoVersion 1
Loading…
Cancel
Save