Open Sheharyar570 opened 1 day ago
@Sheharyar570 thanks for the report. Can you please provide the settings for all the *_cost function GUCs: https://www.postgresql.org/docs/current/runtime-config-query.html#RUNTIME-CONFIG-QUERY-CONSTANTS
Have you run ANALYZE
on the table? Does that help?
Also running timescale-tune might help. Can you try that too?
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