Improve performance of fts5 writes by writing the "averages" record once at

the end of each transaction instead of every time the table is updated.

FossilOrigin-Name: 2b210d691462b463796e7948399133c296e89ebf
This commit is contained in:
dan 2017-02-27 17:06:56 +00:00
parent 8a89d834d6
commit 81415257ec
3 changed files with 9 additions and 20 deletions

View File

@ -545,11 +545,6 @@ int sqlite3Fts5StorageDelete(Fts5Storage *p, i64 iDel, sqlite3_value **apVal){
}
}
/* Write the averages record */
if( rc==SQLITE_OK ){
rc = fts5StorageSaveTotals(p);
}
return rc;
}
@ -753,11 +748,6 @@ int sqlite3Fts5StorageIndexInsert(
}
sqlite3_free(buf.p);
/* Write the averages record */
if( rc==SQLITE_OK ){
rc = fts5StorageSaveTotals(p);
}
return rc;
}
@ -1094,9 +1084,9 @@ int sqlite3Fts5StorageRowCount(Fts5Storage *p, i64 *pnRow){
int sqlite3Fts5StorageSync(Fts5Storage *p, int bCommit){
int rc = SQLITE_OK;
i64 iLastRowid = sqlite3_last_insert_rowid(p->pConfig->db);
if( bCommit && p->bTotalsValid ){
if( p->bTotalsValid ){
rc = fts5StorageSaveTotals(p);
p->bTotalsValid = 0;
if( bCommit ) p->bTotalsValid = 0;
}
if( rc==SQLITE_OK ){
rc = sqlite3Fts5IndexSync(p->pIndex, bCommit);

View File

@ -1,5 +1,5 @@
C Add\san\ssqlite3_set_last_insert_rowid()\smethod.\sUse\sit\sto\swork\saround\sfts4\sand\nfts5\smodifying\sthe\slast-insert-rowid\sunintuitively\sfrom\swithin\scommit\nprocessing.
D 2017-02-27T16:15:29.690
C Improve\sperformance\sof\sfts5\swrites\sby\swriting\sthe\s"averages"\srecord\sonce\sat\nthe\send\sof\seach\stransaction\sinstead\sof\severy\stime\sthe\stable\sis\supdated.
D 2017-02-27T17:06:56.850
F Makefile.in edb6bcdd37748d2b1c3422ff727c748df7ffe918
F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
F Makefile.msc a89ea37ab5928026001569f056973b9059492fe2
@ -106,7 +106,7 @@ F ext/fts5/fts5_expr.c c6ecc2280162a3714d15dce2a8f2299f748b627c
F ext/fts5/fts5_hash.c 880998e596b60f078348d48732ca4ad9a90caad2
F ext/fts5/fts5_index.c f67032a9a529ba52a545e6e3ab970764199c05d4
F ext/fts5/fts5_main.c f85281445dcf8be32d18841c93a6f90fe27dbfe2
F ext/fts5/fts5_storage.c 1db0b6f859ce910027245cf41e8a32c7aaed0042
F ext/fts5/fts5_storage.c 8f0e65cb33bde8f449e1c9b4be4600d18b4da6e9
F ext/fts5/fts5_tcl.c 4a901f00c8553740dba63511603f5527d741c26a
F ext/fts5/fts5_test_mi.c 783b86697ebf773c18fc109992426c0173a055bc
F ext/fts5/fts5_test_tok.c db08af63673c3a7d39f053b36fd6e065017706be
@ -1559,8 +1559,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
P 660f9569d76e4ff1f5bd4f37f640e6a4fc2cf87d fe41bb5632a5d438acfd682809f1bd12315b970a
R 882d86f84a56568be3256ca713764e4e
T +closed fe41bb5632a5d438acfd682809f1bd12315b970a
P 952a3906b30a818e4574bb85f57150577d04f74e
R 84bac8b8e25067f97464b8201fd688d3
U dan
Z 5437a317a211c2826dc04cbed3f42658
Z 50f45fcec707e33cc33fa8432e53c9b6

View File

@ -1 +1 @@
952a3906b30a818e4574bb85f57150577d04f74e
2b210d691462b463796e7948399133c296e89ebf