Add a comment to fts3SyncMethod() to justify the nMinMerge=64 constant.

FossilOrigin-Name: af55ca5fc6778cb6d1a79a17dfa2d4e567ea1ccc
This commit is contained in:
dan 2012-03-24 16:43:55 +00:00
parent 790964ebc4
commit 0dfcdeb4f0
3 changed files with 29 additions and 8 deletions

View File

@ -3103,7 +3103,28 @@ static int fts3UpdateMethod(
** hash-table to the database. ** hash-table to the database.
*/ */
static int fts3SyncMethod(sqlite3_vtab *pVtab){ static int fts3SyncMethod(sqlite3_vtab *pVtab){
/* Following an incremental-merge operation, assuming that the input
** segments are not completely consumed (the usual case), they are updated
** in place to remove the entries that have already been merged. This
** involves updating the leaf block that contains the smallest unmerged
** entry and each block (if any) between the leaf and the root node. So
** if the height of the input segment b-trees is N, and input segments
** are merged eight at a time, updating the input segments at the end
** of an incremental-merge requires writing (8*(1+N)) blocks. N is usually
** small - often between 0 and 2. So the overhead of the incremental
** merge is somewhere between 8 and 24 blocks. To avoid this overhead
** dwarfing the actual productive work accomplished, the incremental merge
** is only attempted if it will write at least 64 leaf blocks. Hence
** nMinMerge.
**
** Of course, updating the input segments also involves deleting a bunch
** of blocks from the segments table. But this is not considered overhead
** as it would also be required by a crisis-merge that used the same input
** segments.
*/
const int nMinMerge = 64; /* Minimum amount of incr-merge work to do */ const int nMinMerge = 64; /* Minimum amount of incr-merge work to do */
Fts3Table *p = (Fts3Table*)pVtab; Fts3Table *p = (Fts3Table*)pVtab;
int rc = sqlite3Fts3PendingTermsFlush(p); int rc = sqlite3Fts3PendingTermsFlush(p);

View File

@ -1,5 +1,5 @@
C Fix\sa\sbug\sin\sdebugging\scode\senabled\swhen\sFTS3_LOG_MERGES\sis\sdefined. C Add\sa\scomment\sto\sfts3SyncMethod()\sto\sjustify\sthe\snMinMerge=64\sconstant.
D 2012-03-24T16:18:08.837 D 2012-03-24T16:43:55.163
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in 2f37e468503dbe79d35c9f6dffcf3fae1ae9ec20 F Makefile.in 2f37e468503dbe79d35c9f6dffcf3fae1ae9ec20
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@ -63,7 +63,7 @@ F ext/fts3/README.content fdc666a70d5257a64fee209f97cf89e0e6e32b51
F ext/fts3/README.syntax a19711dc5458c20734b8e485e75fb1981ec2427a F ext/fts3/README.syntax a19711dc5458c20734b8e485e75fb1981ec2427a
F ext/fts3/README.tokenizers 998756696647400de63d5ba60e9655036cb966e9 F ext/fts3/README.tokenizers 998756696647400de63d5ba60e9655036cb966e9
F ext/fts3/README.txt 8c18f41574404623b76917b9da66fcb0ab38328d F ext/fts3/README.txt 8c18f41574404623b76917b9da66fcb0ab38328d
F ext/fts3/fts3.c eb3a57bb7913e83727f6bcb1142375df5637478f F ext/fts3/fts3.c 10988e19ba78d846e5979a5118843e22822a0147
F ext/fts3/fts3.h 3a10a0af180d502cecc50df77b1b22df142817fe F ext/fts3/fts3.h 3a10a0af180d502cecc50df77b1b22df142817fe
F ext/fts3/fts3Int.h 6d4ffaca18df57533a7d6240dbdd835c4f3f096a F ext/fts3/fts3Int.h 6d4ffaca18df57533a7d6240dbdd835c4f3f096a
F ext/fts3/fts3_aux.c 5205182bd8f372782597888156404766edf5781e F ext/fts3/fts3_aux.c 5205182bd8f372782597888156404766edf5781e
@ -997,7 +997,7 @@ F tool/tostr.awk e75472c2f98dd76e06b8c9c1367f4ab07e122d06
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
F tool/warnings-clang.sh 9f406d66e750e8ac031c63a9ef3248aaa347ef2a F tool/warnings-clang.sh 9f406d66e750e8ac031c63a9ef3248aaa347ef2a
F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381 F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381
P 67a0cffc9d07be7f09dad9d019a18160711295cd P 2e06babf49de844d0e878d68114dbcc5ad4d6e54
R b9a75c391c5508df678e65c2562d628a R 432c0c36d101ff48a9d07485fc32e9b8
U drh U dan
Z 4e5e71ac5e6024845db251d7d739e1ab Z 314cc4329e06c95183ea81ebec52b3f5

View File

@ -1 +1 @@
2e06babf49de844d0e878d68114dbcc5ad4d6e54 af55ca5fc6778cb6d1a79a17dfa2d4e567ea1ccc