From: rferraton (@rferraton) <noreply+rferraton@github.com>
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Subject: Re: [pgvector/pgvector] issue #781: index not used with cte
Date: Sat, 22 Feb 2025 22:56:12 +0000
Message-ID: <gh-pgvector-pgvector-781-c2676437807@github.com> (raw)
In-Reply-To: <gh-pgvector-pgvector-781@github.com>
References: <gh-pgvector-pgvector-781@github.com>
Agree !
This last query you provide (that avoid join with the cte and use a sub-select instead) works greats :
```
Limit (cost=1267.94..1284.18 rows=10 width=27) (actual time=15.346..16.651 rows=10 loops=1)
InitPlan 1
-> Index Scan using dbpedia_14_chunk_index_idx on dbpedia_14 (cost=0.42..8.44 rows=1 width=18) (actual time=0.155..0.156 rows=1 loops=1)
Index Cond: (chunk_index = 473679)
-> Index Scan using dbpedia_14_chunk_embedding_idx on dbpedia_14 a (cost=1259.49..1024652.46 rows=630073 width=27) (actual time=15.344..16.646 rows=10 loops=1)
Order By: (chunk_embedding <-> (InitPlan 1).col1)
Planning Time: 1.475 ms
Execution Time: 16.745 ms
```