mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-06 20:50:57 +08:00
Do not use index without limit or if limit + offset > expected tuples
This commit is contained in:
@@ -83,8 +83,11 @@ hnswcostestimate(PlannerInfo *root, IndexPath *path, double loop_count,
|
||||
List *qinfos;
|
||||
#endif
|
||||
|
||||
/* Never use index without order */
|
||||
if (path->indexorderbys == NULL)
|
||||
/*
|
||||
* Never use index without order or limit, or if limit + offset >
|
||||
* ef_search
|
||||
*/
|
||||
if (path->indexorderbys == NULL || root->limit_tuples < 0 || root->limit_tuples > hnsw_ef_search)
|
||||
{
|
||||
*indexStartupCost = DBL_MAX;
|
||||
*indexTotalCost = DBL_MAX;
|
||||
|
||||
Reference in New Issue
Block a user