tursodatabase / libsql

libSQL is a fork of SQLite that is both Open Source, and Open Contributions.
https://turso.tech/libsql
MIT License
9.54k stars 252 forks source link

fix: prevent incorrect range queries when searching for a page version #1528

Closed avinassh closed 2 months ago

avinassh commented 2 months ago

It is important to verify that the data we got from Foundation DB matches with what we want, since we are doing a range query.

for example, say we searched for ('db_name42', 10, 20). If this page does not exist, then it could match with ('db_name41', 10, 20) or with ('db_name42', 9, 20) since it does lexicographic search.

avinassh commented 2 months ago

is there a way to prevent fetching a page we are not interested in?

This query is checking index only for the right frame number for the page. It does not fetch the frame.