Current Status
pg_textsearch today
- 2.8x faster overall query throughput
- Faster on all query lengths (1-8+ tokens)
- Smaller index (no positions stored)*
- Parallel index build (4 workers)
- Native Postgres integration
System X v0.21.6
- Faster index build (2x)
- Phrase queries supported
- Larger feature set (facets, etc.)
Recent Improvements
Index Size & Build Time
| Metric | pg_textsearch | System X | Difference |
|---|---|---|---|
| Index Size | 1,189 MB | 1,503 MB | -21% |
| Build Time | 269.5 sec | 137.9 sec | +95% |
| Documents | 8,841,823 | - | |
"quick brown fox". System X stores
positions by default, which adds significant overhead but enables phrase search.
This accounts for most of the index size difference—it's a feature tradeoff, not
a compression advantage.
Query Latency (p50)
Median latency in milliseconds. Lower is better.
| Query Tokens | pg_textsearch | System X | Difference |
|---|---|---|---|
| 1 token | 1.51 ms | 17.29 ms | -91% |
| 2 tokens | 2.24 ms | 17.23 ms | -87% |
| 3 tokens | 3.85 ms | 22.53 ms | -83% |
| 4 tokens | 5.54 ms | 24.31 ms | -77% |
| 5 tokens | 8.41 ms | 26.81 ms | -69% |
| 6 tokens | 12.98 ms | 33.65 ms | -61% |
| 7 tokens | 18.02 ms | 33.98 ms | -47% |
| 8+ tokens | 27.95 ms | 41.23 ms | -32% |
Query Latency (p95)
95th percentile latency in milliseconds. Lower is better.
| Query Tokens | pg_textsearch | System X | Difference |
|---|---|---|---|
| 1 token | 2.10 ms | 22.60 ms | -91% |
| 2 tokens | 4.92 ms | 28.76 ms | -83% |
| 3 tokens | 10.26 ms | 33.37 ms | -69% |
| 4 tokens | 17.37 ms | 33.94 ms | -49% |
| 5 tokens | 26.03 ms | 36.19 ms | -28% |
| 6 tokens | 29.20 ms | 55.70 ms | -48% |
| 7 tokens | 47.63 ms | 61.52 ms | -23% |
| 8+ tokens | 60.42 ms | 67.77 ms | -11% |
Throughput
Total time to execute 800 test queries sequentially.
| Metric | pg_textsearch | System X | Difference |
|---|---|---|---|
| Total time | 8.39 sec | 23.34 sec | -64% |
| Avg ms/query | 10.48 ms | 29.18 ms | -64% |
Analysis
Query latency: pg_textsearch faster across all token counts
pg_textsearch is faster on all 8 token buckets at p50, ranging from 11x faster on single-token queries to 1.5x faster on 8+ token queries. The Block-Max WAND implementation with WAND pivot selection (PR #210) improved multi-token performance by 30-43% compared to the previous release, closing what had been a gap on longer queries.
Overall throughput: pg_textsearch 2.8x faster
pg_textsearch completes 800 queries in 8.4s vs 23.3s for System X, a 2.8x throughput advantage. This is up from 1.8x in the February 6 comparison, driven by the WAND pivot selection improvements on multi-token queries.
Index build: System X still faster
System X builds its index in 138s vs 270s for pg_textsearch (2.0x faster). pg_textsearch uses parallel build with 4 workers, which cut build time roughly in half from the single-threaded baseline.
Methodology
Both extensions benchmarked on identical GitHub Actions runners with the same Postgres configuration. See full methodology for details.