Performance

Benchmarks

How long the engine takes to answer list requests on a 200,000-row PostgreSQL table, and what makes a request expensive.

Every number below comes from an orders table with 200,000 rows, measured without HTTP: the engine's own cost, not your API's latency. Timings are medians of ten runs from one client, unless the section is about load.

What a request costs

Returning a page is almost free, even 180,000 rows deep with a cursor. What you pay for is counting: an exact total reads every matching row, and facets group them again. Leave both off when the screen doesn't show them.

Time per request, milliseconds
0204060Page: 0.51 msPagerows only0.51 msCursor page: 1.1 msCursor page180,000 rows in1.1 ms1,000 ids filter: 2.8 ms1,000 ids filter2.8 msPage + exact count: 4.2 msPage + exact count4.2 msSearch a relation + count: 17 msSearch a relation + count17 ms3 facets: 25 ms3 facetsone statement25 msFiltered facets: 36 msFiltered facetseach ignores its own filter36 ms5 facets: 57 ms5 facetstwo statements57 ms

Yellow: no count and no facets.

Facets on the root table share one GROUPING SETS statement. Facets that read relations need their own, which is why five mixed facets cost more than three root ones. See Performance for what to do about each.

Under load

With 32 callers sharing 10 pooled connections, and PostgreSQL held to 4 CPUs, a plain page serves about 11,500 requests a second. Counting is again what limits you: an exact count brings that to about 730, and five facets to about 19.

Throughput at 32 concurrent callers, requests per second
05,00010,00015,000Page: 11,563/sPagep95 3.5 ms11,563/sCursor page: 5,746/sCursor page180,000 rows in · p95 8.3 ms5,746/s1,000 ids filter: 1,741/s1,000 ids filterp95 23 ms1,741/sPage + exact count: 729/sPage + exact countp95 67 ms729/sSearch a relation + count: 124/sSearch a relation + countp95 287 ms124/s3 facets: 74/s3 facetsp95 476 ms74/sFiltered facets: 32/sFiltered facetsp95 1.0 s32/s5 facets: 19/s5 facetsp95 2.1 s19/s

20 rounds of 32 requests each. Yellow: no count and no facets.

The gap is the amount of work. A page walks the sort index, takes 50 rows and stops; each facet reads and groups all 200,000. With 4 CPUs, that works out to at most about 0.35 ms of database CPU per page, against about 210 ms per five-facet request. Pages and cursors stay under 10 ms at p95 with the pool fully busy. Facet requests are the ones to cache, defer, or tune before you add connections.

Searching through relations

A search on related fields, like customer.name, can join every order to its customer, or find the matching customers first. The engine asks PostgreSQL which plan is cheaper and picks it.

Search with an exact count, millisecondsone fixed planengine picks the plan
0255075100Rare term, customer: 87 ms → 4.1 msRare term, customer87 ms4.1 msRare term, reference: 85 ms → 6.3 msRare term, reference85 ms6.3 msCommon term: 22 ms → 23 msCommon term22 ms23 ms

Measured on September 21, 2026, when the engine started picking the plan.

Rare terms get 13 to 21 times faster. Common terms match on the first rows anyway, so asking for the plan just adds about 1 ms.

Exporting every row

900 msto stream all 200,000 rows with resource.scan()

Paging through the same rows re-runs the whole selection for every page of 1,000. scan() keeps one cursor open instead, and the gap grows with the cost of the sort.

All 200,000 rows, seconds200 page requestsone scan()
0246Sorted by date: 1.02 s → 0.93 sSorted by date1.02 s0.93 sSorted by customer: 5.18 s → 0.85 sSorted by customer5.18 s0.85 s

A scan holds a connection and a snapshot until your consumer finishes.

Since version 2.4.1

The same requests on version 2.4.1 (September 2026), measured in the same run: before the engine learned to skip redundant joins, share facet statements and seek straight to a cursor.

Time per request, milliseconds, log scale2.4.1today
1 ms10 ms100 msPage: 40 ms → 0.51 msPage78× faster Cursor page, 180,000 in: 20 ms → 1.1 msCursor page, 180,000 in18× faster Page + exact count: 62 ms → 4.2 msPage + exact count15× faster Search a relation: 79 ms → 17 msSearch a relation5× faster 3 facets: 90 ms → 25 ms3 facets4× faster 5 facets: 195 ms → 57 ms5 facets3× faster Filtered facets: 138 ms → 36 msFiltered facets4× faster

Details

Copyright © 2026