[YSQL] Seek Forward Optimization is not modeled in cost model #25902
Labels
area/ysql
Yugabyte SQL (YSQL)
kind/enhancement
This is an enhancement of an existing feature
priority/medium
Medium priority issue
status/awaiting-triage
Issue awaiting triage
Jira Link: DB-15215
Description
Seek forward optimization reduces the number of expensive seek operations needed in lookup of a key in DocDB.
Before seeking to the next key, we check if the key can be found in the subsequent few tuples by performing cheaper
next
operations. Only if the key is not found, we proceed toseek
to the key. The number of nexts performed is controlled by themax_nexts_to_avoid_seek
yb-master
gflag.In the cost model, we currently assume that seek-forward optimization yields no benefit, or in other words the key is never found in the subsequent next operations.
For example,
In the following examples, the keys we are close by and the optimization will help reduce the number of seeks. The cost model over-estimates the seeks.
In the following case however, when keys are further apart, DocDB must perform seeks. In this case, the estimates from the model are correct.
Issue Type
kind/enhancement
Warning: Please confirm that this issue does not contain any sensitive information
The text was updated successfully, but these errors were encountered: