Sessions and end users: list reads on both engines
Last updated: 2026-11-26T04:27:10-03:00 (UTC-3)
How long the Sessions and Users scopes take to answer on each span engine (spans.engine: database or analytics_store), with the same data in both, and what the end user rollup changed on PostgreSQL.
What to expect
Section titled “What to expect”- Sessions are fast on both engines. A first page reads the session summaries the span writer keeps: on PostgreSQL 0.2 to 27 ms (p50) whatever the filter, on the analytics store 4 to 67 ms (it groups the trace rows of the range, then folds the page exactly).
- End users needed a rollup on PostgreSQL. Summing a month of trace summaries on every read took about 2 s at a million traces (0.4 s for a week). The database engine now keeps the trace summaries summed by team, organization, end user and hour, written in the same transaction as each span batch; a read takes the whole hours from it and the two partial hours at the ends of its range from the trace summaries, so the figures do not change. A 30-day first page went from 2,068 ms to 76 ms (p50), a week from 408 ms to 37 ms. An erasure deletes the end user’s rollup rows in its own transaction.
- The analytics store sums on read and stays between 52 and 223 ms (p50) for every end user read measured, so it has no rollup. Since the review round its
sessionscounts the sessions each end user owns, as PostgreSQL does, which adds one grouping of the range’s sessions (30-day first page from about 124 to 212 ms p50; re-measured after the change).
Method
Section titled “Method”A probe in the gateway’s test suite (internal/gateway/session_explorer_probe_test.go, run only on request with GATEWAY_SESSION_PROBE=<traces>) writes the summary rows straight into the engine (the shape the span writer leaves, without writing every span): one million traces over 30 days in two teams of two organizations, a session of ten traces 30 s apart (100,000 sessions), ten sessions per end user (10,000 end users), 2.7% of traces in error. Each read runs through the same functions the API calls, 20 times after one warm-up; p50 and p95 in milliseconds. The ranges end now: “24 h” and “7 d” are the most recent part of the month, “30 d” all of it. Both lists have one order (most recent activity first), so the sorts measured are that order with its cursor.
Real traffic is burstier or flatter per end user than this: the rollup holds one row per end user and hour with traffic, so its size is between the number of sessions and the number of traces. The figures compare the engines and the two PostgreSQL read paths on the same data; they are not a capacity promise.
The recorded runs are in sessions-and-users.json.
1,000,000 traces, 100,000 sessions, 10,000 end users, 2 teams in 2 organizations, 30 days
Section titled “1,000,000 traces, 100,000 sessions, 10,000 end users, 2 teams in 2 organizations, 30 days”| Read | Rows | PostgreSQL, summed on read p50 (ms) | p95 (ms) | PostgreSQL, with the rollup p50 (ms) | p95 (ms) | Analytics store p50 (ms) | p95 (ms) |
|---|---|---|---|---|---|---|---|
| Sessions: first page, 24 h | 51 | 1.4 | 1.6 | 1.3 | 1.5 | 21.7 | 28.1 |
| Sessions: first page, 7 d | 51 | 7.4 | 13.8 | 6.8 | 7.5 | 28.4 | 34.2 |
| Sessions: first page, 30 d | 51 | 26.8 | 47.4 | 26.2 | 27.6 | 49.4 | 60.2 |
| Sessions: first page, 30 d, one team | 51 | 17.7 | 18.2 | 17.8 | 18.9 | 52.7 | 60.1 |
| Sessions: end_user: |
10 | 10.4 | 12.7 | 9.4 | 10.5 | 66.6 | 270 |
| Sessions: session.traces>=10, 7 d | 51 | 7.3 | 7.6 | 6.7 | 7.1 | 36.5 | 48.4 |
| Sessions: cost>0.0006, 7 d | 51 | 18.2 | 18.5 | 17.0 | 17.7 | 32.8 | 42.8 |
| Sessions: totals, 7 d | 23,343 | 4.1 | 4.7 | 3.5 | 3.6 | 35.9 | 47.8 |
| Sessions: one session by ID | 1 | 0.2 | 0.4 | 0.2 | 0.3 | 4.0 | 6.8 |
| End users: first page, 24 h | 51 | 47.9 | 49.4 | 13.2 | 14.8 | 52.2 | 109 |
| End users: first page, 7 d | 51 | 408 | 478 | 36.6 | 40.3 | 85.4 | 95.4 |
| End users: first page, 30 d | 51 | 2,068 | 2,112 | 76.2 | 108 | 212 | 252 |
| End users: first page, 30 d, one team | 51 | 578 | 618 | 104 | 205 | 174 | 201 |
| End users: user.sessions>=10, 30 d | 51 | 2,008 | 2,076 | 104 | 159 | 223 | 264 |
| End users: one end user, 30 d | 1 | 0.3 | 0.4 | 1.4 | 3.9 | 190 | 213 |
| End users: totals, 7 d | 10,000 | 305 | 386 | 39.2 | 56.2 | 89.7 | 95.2 |
Loading the data took 15 s, 16 s and 1 s; each read ran 20 times after one warm-up. A page asks for 51 rows (50 and one to know whether a page follows).