From: ankane (@ankane) <noreply+ankane@github.com>
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Subject: Re: [pgvector/pgvector] issue #821: avg_width for Vector is 18 and for HalfVec is 1544
Date: Tue, 15 Apr 2025 21:48:36 +0000
Message-ID: <gh-pgvector-pgvector-821-c2807600470@github.com> (raw)
In-Reply-To: <gh-pgvector-pgvector-821@github.com>
References: <gh-pgvector-pgvector-821@github.com>
When a column is stored out of line, there's a rough [adjustment](https://github.com/pgvector/pgvector/blob/v0.8.0/src/hnsw.c#L202-L211) to favor the index, which is likely what's happening in the vector case.
Both plans execute very fast for this query, but for more control, check out the [pg_hint_plan extension](https://github.com/ossc-db/pg_hint_plan). Also, the random page cost being off (like the default is when using an SSD) can contribute to the planner making suboptimal decisions.