mirror of
https://github.com/postgres/postgres.git
synced 2025-12-21 05:21:08 +03:00
Teach btree to handle ScalarArrayOpExpr quals natively.
This allows "indexedcol op ANY(ARRAY[...])" conditions to be used in plain indexscans, and particularly in index-only scans.
This commit is contained in:
@@ -394,9 +394,14 @@ cost_index(IndexPath *path, PlannerInfo *root,
|
||||
if (indexonly)
|
||||
pages_fetched = ceil(pages_fetched * (1.0 - baserel->allvisfrac));
|
||||
|
||||
min_IO_cost = spc_random_page_cost;
|
||||
if (pages_fetched > 1)
|
||||
min_IO_cost += (pages_fetched - 1) * spc_seq_page_cost;
|
||||
if (pages_fetched > 0)
|
||||
{
|
||||
min_IO_cost = spc_random_page_cost;
|
||||
if (pages_fetched > 1)
|
||||
min_IO_cost += (pages_fetched - 1) * spc_seq_page_cost;
|
||||
}
|
||||
else
|
||||
min_IO_cost = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user