Most reads and writes in the DiskANN algorithm performed with sqlite3_blob_* API which are invisible to the LibSQL "accounting" machinery as they operates on it's own instance of Vdbe structure.
This PR brings visibility into read/written rows in DiskANN implementation.
Changes
Make DiskANN algorithm to return read/written rows in the internal API
All reads and writes recorded in the DiskAnnIndex handle
Make vectorIndex internal API to return read/written rows:
vectorIndexSearch accepts 2 out parameters int *nReads and int *nWrites which will be populated with the data from DiskAnnIndex fields
vectorIndexCursorClose accepts 2 out parameters too - and this is enough as all other operations (INSERT/DELETE) performed via cursor
Add isTracked field to VdbeCursor
Add special logic for cursor with isTracked=1: treat cursor pointer as extended version of cursor struct sqlite3_vtab_cursor_tracked and update counters accordingly
Context
Most reads and writes in the DiskANN algorithm performed with
sqlite3_blob_*
API which are invisible to theLibSQL
"accounting" machinery as they operates on it's own instance ofVdbe
structure.This PR brings visibility into read/written rows in DiskANN implementation.
Changes
DiskANN
algorithm to return read/written rows in the internal APIDiskAnnIndex
handlevectorIndex
internal API to return read/written rows:vectorIndexSearch
accepts 2out
parametersint *nReads
andint *nWrites
which will be populated with the data fromDiskAnnIndex
fieldsvectorIndexCursorClose
accepts 2out
parameters too - and this is enough as all other operations (INSERT
/DELETE
) performed via cursorisTracked
field toVdbeCursor
isTracked=1
: treat cursor pointer as extended version of cursor structsqlite3_vtab_cursor_tracked
and update counters accordingly