You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encountered a performance issue while running tests on PostgreSQL 16.4 with the pgvectorscale extension and DiskANN configuration. Below are the details of my setup: Database Configuration:
When running a test with enable_seqscan set to on, I observed significantly lower query performance compared to when it was turned off. Observed Results: With enable_seqscan=on:
QPS: 2.5511
Execution plan shows the query planner favoring a Parallel Sequential Scan despite an index being available. With enable_seqscan=off:
QPS: 3130.1343
Execution plan utilizes the Index Scan, resulting in dramatically improved performance.
Execution Plans: With enable_seqscan=on:
The planner chooses a Parallel Sequential Scan, with execution taking ~713ms.
(Relevant details from the EXPLAIN ANALYZE output)
The planner opts for an Index Scan, with execution completing in ~12ms.
(Relevant details from the EXPLAIN ANALYZE output)
Limit (cost=20041.50..20041.92 rows=10 width=16) (actual time=11.334..11.960 rows=10 loops=1)
-> Index Scan using pgvectorscale_index on pg_vectorscale_collection (cost=20041.50..40999.50 rows=500000 width=16) (actual time=11.333..11.957 rows=10 loops=1)
Order By: (embedding <=> '[0.0041067647,-0.0126647325,-0.0024094123,-0.011227365,-0.016559536,0.014572391,0.009068001,-0.020348357,-0.01203547,0.007226581,-0.009213725,0.0072994432,
-0.017698832,-0.014108724,-0.021302186,0.009167358,0.024362387,-0.026879437,..........
-0.020017166,-0.021686368,-0.0018463882,-0.010313278,0.0035205572,-0.004802265,-0.009438935]'::vector)
Planning Time: 0.064 ms
Execution Time: 12.080 ms
This behavior suggests that enabling enable_seqscan causes the query planner to prioritize Parallel Sequential Scans over Index Scans, even when the latter performs significantly better.
The preference for Parallel Sequential Scan when enable_seqscan is enabled seems suboptimal for this use case. Could this be a bug, or is there a configuration adjustment that I’m missing? Any guidance or insights into this behavior would be greatly appreciated.
What happened?
I encountered a performance issue while running tests on PostgreSQL 16.4 with the pgvectorscale extension and DiskANN configuration. Below are the details of my setup:
Database Configuration:
DiskANN Configuration:
When running a test with enable_seqscan set to
on
, I observed significantly lower query performance compared to when it was turnedoff
.Observed Results:
With enable_seqscan=
on
:QPS:
2.5511
Execution plan shows the query planner favoring a Parallel Sequential Scan despite an index being available.
With enable_seqscan=
off
:QPS:
3130.1343
Execution plan utilizes the Index Scan, resulting in dramatically improved performance.
Execution Plans:
With enable_seqscan=
on
:The planner chooses a Parallel Sequential Scan, with execution taking ~713ms.
(Relevant details from the EXPLAIN ANALYZE output)
With enable_seqscan=
off
:This behavior suggests that enabling enable_seqscan causes the query planner to prioritize Parallel Sequential Scans over Index Scans, even when the latter performs significantly better.
The preference for Parallel Sequential Scan when enable_seqscan is enabled seems suboptimal for this use case. Could this be a bug, or is there a configuration adjustment that I’m missing? Any guidance or insights into this behavior would be greatly appreciated.
pgvectorscale extension affected
0.4.0
PostgreSQL version used
16.4
What operating system did you use?
22.04
What installation method did you use?
Source
What platform did you run on?
Microsoft Azure Cloud
Relevant log output and stack trace
How can we reproduce the bug?
DiskAnn Configuration:
Make sure to set enable_seqscan
on
The text was updated successfully, but these errors were encountered: