tursodatabase / libsql

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

vector search: fix integrity check #1687

Closed sivukhin closed 2 months ago

sivukhin commented 2 months ago

Context

Before vector search indices produced integrity check errors because for SQLite core they looks like empty B-Tree indices.

This PR simply exclude vector indices from integrity_check pragma:

libsql> CREATE TABLE t (e FLOAT32(2));
libsql> INSERT INTO t VALUES (vector('[1,2]')), (vector('[2,3]'));
libsql> CREATE INDEX t_idx ON t(libsql_vector_idx(e));
libsql> PRAGMA integrity_check;
ok

This is important as integrity_check plays key role in DB validation process and can ruin some components even in LibSQL (like bottomless)