You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -212078,9 +212080,31 @@ int diskAnnCreateIndex(
212078
212080
columnSqlDefs,
212079
212081
columnSqlNames
212080
212082
);
212083
+
zRowidColumnName = "rowid";
212081
212084
}
212082
212085
rc = sqlite3_exec(db, zSql, 0, 0, 0);
212083
212086
sqlite3DbFree(db, zSql);
212087
+
if( rc != SQLITE_OK ){
212088
+
return rc;
212089
+
}
212090
+
/*
212091
+
* vector blobs are usually pretty huge (more than a page size, for example, node block for 1024d f32 embeddings with 1bit compression will occupy ~20KB)
212092
+
* in this case, main table B-Tree takes on redundant shape where all leaf nodes has only 1 cell
212093
+
*
212094
+
* as we have a query which selects random row using OFFSET/LIMIT trick - we will need to read all these leaf nodes pages just to skip them
212095
+
* so, in order to remove this overhead for random row selection - we creating an index with just single column used
212096
+
* in this case B-Tree leafs will be full of rowids and the overhead for page reads will be very small
212097
+
*/
212098
+
zSql = sqlite3MPrintf(
212099
+
db,
212100
+
"CREATE INDEX IF NOT EXISTS \"%w\".%s_shadow_idx ON %s_shadow (%s)",
@@ -212078,9 +212080,31 @@ int diskAnnCreateIndex(
212078
212080
columnSqlDefs,
212079
212081
columnSqlNames
212080
212082
);
212083
+
zRowidColumnName = "rowid";
212081
212084
}
212082
212085
rc = sqlite3_exec(db, zSql, 0, 0, 0);
212083
212086
sqlite3DbFree(db, zSql);
212087
+
if( rc != SQLITE_OK ){
212088
+
return rc;
212089
+
}
212090
+
/*
212091
+
* vector blobs are usually pretty huge (more than a page size, for example, node block for 1024d f32 embeddings with 1bit compression will occupy ~20KB)
212092
+
* in this case, main table B-Tree takes on redundant shape where all leaf nodes has only 1 cell
212093
+
*
212094
+
* as we have a query which selects random row using OFFSET/LIMIT trick - we will need to read all these leaf nodes pages just to skip them
212095
+
* so, in order to remove this overhead for random row selection - we creating an index with just single column used
212096
+
* in this case B-Tree leafs will be full of rowids and the overhead for page reads will be very small
212097
+
*/
212098
+
zSql = sqlite3MPrintf(
212099
+
db,
212100
+
"CREATE INDEX IF NOT EXISTS \"%w\".%s_shadow_idx ON %s_shadow (%s)",
* vector blobs are usually pretty huge (more than a page size, for example, node block for 1024d f32 embeddings with 1bit compression will occupy ~20KB)
532
+
* in this case, main table B-Tree takes on redundant shape where all leaf nodes has only 1 cell
533
+
*
534
+
* as we have a query which selects random row using OFFSET/LIMIT trick - we will need to read all these leaf nodes pages just to skip them
535
+
* so, in order to remove this overhead for random row selection - we creating an index with just single column used
536
+
* in this case B-Tree leafs will be full of rowids and the overhead for page reads will be very small
537
+
*/
538
+
zSql=sqlite3MPrintf(
539
+
db,
540
+
"CREATE INDEX IF NOT EXISTS \"%w\".%s_shadow_idx ON %s_shadow (%s)",
0 commit comments