]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Add a comment to the FTS getAbsoluteLevel() function. No actual code changes.
authordan <dan@noemail.net>
Fri, 16 Mar 2012 14:54:07 +0000 (14:54 +0000)
committerdan <dan@noemail.net>
Fri, 16 Mar 2012 14:54:07 +0000 (14:54 +0000)
FossilOrigin-Name: 7e0f861beda4d74d0c3c9fb4abb3ddb5fee346bd

ext/fts3/fts3_write.c
manifest
manifest.uuid

index a6ee1f6919f0ac213c9ef681c4e7718e9153de0c..f9cb3667c662b00a0e495331383f1f4f7b8a1e67 100644 (file)
@@ -481,11 +481,34 @@ int sqlite3Fts3ReadLock(Fts3Table *p){
   return rc;
 }
 
+/*
+** FTS maintains a separate indexes for each language-id (a 32-bit integer).
+** Within each language id, a separate index is maintained to store the
+** document terms, and each configured prefix size (configured the FTS 
+** "prefix=" option). And each index consists of multiple levels ("relative
+** levels").
+**
+** All three of these values (the language id, the specific index and the
+** level within the index) are encoded in 64-bit integer values stored
+** in the %_segdir table on disk. This function is used to convert three
+** separate component values into the single 64-bit integer value that
+** can be used to query the %_segdir table.
+**
+** Specifically, each language-id/index combination is allocated 1024 
+** 64-bit integer level values ("absolute levels"). The main terms index
+** for language-id 0 is allocate values 0-1023. The first prefix index
+** (if any) for language-id 0 is allocated values 1024-2047. And so on.
+** Language 1 indexes are allocated immediately following language 0.
+**
+** So, for a system with nPrefix prefix indexes configured, the block of
+** absolute levels that corresponds to language-id iLangid and index 
+** iIndex starts at absolute level ((iLangid * (nPrefix+1) + iIndex) * 1024).
+*/
 static sqlite3_int64 getAbsoluteLevel(
-  Fts3Table *p, 
-  int iLangid, 
-  int iIndex, 
-  int iLevel
+  Fts3Table *p,                   /* FTS3 table handle */
+  int iLangid,                    /* Language id */
+  int iIndex,                     /* Index in p->aIndex[] */
+  int iLevel                      /* Level of segments */
 ){
   assert( iLangid>=0 );
   assert( p->nIndex>0 );
index 88b357ba300270173be89af09afacd857bc4ca5d..be0bd8c83f69565e3ab1e4a2a51677bdc9600fc5 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Modify\sincremental\smerge\scode\sto\smerge\snMin\ssegments\sat\sa\stime.
-D 2012-03-15T17:45:50.857
+C Add\sa\scomment\sto\sthe\sFTS\sgetAbsoluteLevel()\sfunction.\sNo\sactual\scode\schanges.
+D 2012-03-16T14:54:07.123
 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
 F Makefile.in 3f79a373e57c3b92dabf76f40b065e719d31ac34
 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -78,7 +78,7 @@ F ext/fts3/fts3_test.c 6b7cc68aef4efb084e1449f7d20c4b20d3bdf6b4
 F ext/fts3/fts3_tokenizer.c 3da7254a9881f7e270ab28e2004e0d22b3212bce
 F ext/fts3/fts3_tokenizer.h 66dec98e365854b6cd2d54f1a96bb6d428fc5a68
 F ext/fts3/fts3_tokenizer1.c 0dde8f307b8045565cf63797ba9acfaff1c50c68
-F ext/fts3/fts3_write.c be60aaf4a887a68aaf0d7541bc78413e7ba66291
+F ext/fts3/fts3_write.c fab92bcc6de43fb6dfd3937ac67e2cb45c834a2b
 F ext/fts3/fts3speed.tcl b54caf6a18d38174f1a6e84219950d85e98bb1e9
 F ext/fts3/mkfts3amal.tcl 252ecb7fe6467854f2aa237bf2c390b74e71f100
 F ext/icu/README.txt bf8461d8cdc6b8f514c080e4e10dc3b2bbdfefa9
@@ -994,7 +994,7 @@ F tool/tostr.awk e75472c2f98dd76e06b8c9c1367f4ab07e122d06
 F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
 F tool/warnings-clang.sh 9f406d66e750e8ac031c63a9ef3248aaa347ef2a
 F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381
-P 570473729d6561d81e6e5f8884fd18487008636e
-R 8deb5f38fb61fdd986c036580c00c7d8
+P cd34bc1af4ba608ea3b52bab55bcfe0086711900
+R c9f36e032863c0b8f751fc4c1ff8b5a5
 U dan
-Z c18f3e75d81727125e658ae77334fefb
+Z b14699878441d211e25f75f7c2630c95
index 08619b20e53c70478e145bc977954dd70de15fa1..ca4d0738bab4612ee38612490e9573b43a29b396 100644 (file)
@@ -1 +1 @@
-cd34bc1af4ba608ea3b52bab55bcfe0086711900
\ No newline at end of file
+7e0f861beda4d74d0c3c9fb4abb3ddb5fee346bd
\ No newline at end of file