pg.ddx.io pgvector/pgvector GitHub issues and pull requests
help / color / mirror / Atom feed[pgvector/pgvector] issue #1035: Performance regression: Range-to-OR equivalent filters cause up to 3.600x search latency difference
3+ messages / 2 participants
[nested] [flat]
* [pgvector/pgvector] issue #1035: Performance regression: Range-to-OR equivalent filters cause up to 3.600x search latency difference
@ 2026-09-29 07:51 "beyond-mountains (@beyond-mountains)" <noreply+beyond-mountains@github.com>
0 siblings, 0 replies; 3+ messages in thread
From: beyond-mountains (@beyond-mountains) @ 2026-09-29 07:51 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
# Performance regression: Range-to-OR equivalent filters cause up to 3.600x search latency difference
## Summary
Equivalent representation: `1≤x≤N ↔ x IN {1,...,N} ↔ x=1 OR x=2 OR ... OR x=N`
Semantically equivalent filters showed a reproduced client end-to-end ANN latency ratio above 2.0x.
Discovery candidates: 9; reproduced configurations: 9.
## Environment
- Backend: PostgreSQL + pgvector
- Database version: PostgreSQL 15.17 (Debian 15.17-1.pgdg12+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14+deb12u1) 12.2.0, 64-bit; pgvector 0.8.2
- Container limit: 8 physical CPU cores, 32 GiB memory
- Dataset: 200000 points, 128 dimensions, correlation=0.85
- HNSW: M=16, efConstruction=128
## Metadata schema and distribution
All listed fields are present and non-null for every pgvector row.
|Field|Type|Domain / generation|
|---|---|---|
|`id`|INT64|Unique sequential ID in `[0, 199999]`|
|`tenant`|INT64|Discrete uniform sample from `[0, 99]`|
|`level`|INT64|Discrete uniform sample from `[0, 31]`|
|`category`|INT64|`tenant + 1`; finite domain `[1, 100]`|
|`category5`|INT64|`tenant % 5 + 1`; finite universe `{1,2,3,4,5}`|
|`age`|INT64|Discrete uniform sample from `[1, 1000]`|
|`parity`|STRING/keyword|`even` when tenant is even, otherwise `odd`|
Vectors are generated around a tenant-specific center with vector/tenant correlation parameter `0.85`; `level` and `age` are sampled independently of tenant. Category, category5, and parity are deterministic functions of tenant.
PostgreSQL B-tree indexes are present on tenant, level, category, category5, age, and parity.
For the strongest case below, the filter selects 60056 / 200000 points (observed selectivity `30.0280%`). The semantic oracle enumerated and directly compared the complete eligible ID sets.
## Strongest reproduced case
- Pattern: Range-to-OR; expression scale=300, K=10, ef_search=16
Original filter:
```sql
age >= 1 AND age <= 300
```
Equivalent filter, abbreviated:
```text
age = 1 OR age = 2 OR ... OR age = 300
```
```python
equivalent_filter = " OR ".join(
f"(age = {value})" for value in range(1, 301)
)
```
- Semantic oracle: equal=True, eligible count=60056
- ANN p50: 0.9765 ms vs 3.5150 ms; symmetric ratio=3.600x; equivalent/original=3.600x
- Exact p50: 107.0102 ms vs 949.2653 ms; ratio=8.871x
- Recall: 0.5100 vs 0.5100; gap=0.0000
- Exact Top-K identical: True
^ permalink raw [nested|flat] 3+ messages in thread
* Re: [pgvector/pgvector] issue #1035: Performance regression: Range-to-OR equivalent filters cause up to 3.600x search latency difference
@ 2026-09-29 07:55 ` "ankane (@ankane)" <noreply+ankane@github.com>
1 sibling, 0 replies; 3+ messages in thread
From: ankane (@ankane) @ 2026-09-29 07:55 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Hi @beyond-mountains, this also doesn't seem like an issue with pgvector.
^ permalink raw [nested|flat] 3+ messages in thread
* Re: [pgvector/pgvector] issue #1035: Performance regression: Range-to-OR equivalent filters cause up to 3.600x search latency difference
@ 2026-09-29 07:55 ` "ankane (@ankane)" <noreply+ankane@github.com>
1 sibling, 0 replies; 3+ messages in thread
From: ankane (@ankane) @ 2026-09-29 07:55 UTC (permalink / raw)
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
@ankane closed this.
^ permalink raw [nested|flat] 3+ messages in thread
end of thread, other threads:[~2026-09-29 07:55 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-09-29 07:51 [pgvector/pgvector] issue #1035: Performance regression: Range-to-OR equivalent filters cause up to 3.600x search latency difference "beyond-mountains (@beyond-mountains)" <noreply+beyond-mountains@github.com>
2026-09-29 07:55 ` "ankane (@ankane)" <noreply+ankane@github.com>
2026-09-29 07:55 ` "ankane (@ankane)" <noreply+ankane@github.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox