Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Also allow UPDATE on virtual tables to use the onepass strategy. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | vtab-onepass |
Files: | files | file ages | folders |
SHA1: |
1aa27d706db9b2e21737ce4b94b47ecd |
User & Date: | dan 2015-09-28 20:03:49.551 |
Context
2015-09-29
| ||
10:11 | Add tests for fts3 and onepass update/delete operations. Also fix a problem with onepass updates that do not affect any rows. (check-in: 820c804468 user: dan tags: vtab-onepass) | |
2015-09-28
| ||
20:03 | Also allow UPDATE on virtual tables to use the onepass strategy. (check-in: 1aa27d706d user: dan tags: vtab-onepass) | |
15:23 | Update fts3 to use the onepass strategy for delete operations. (check-in: fffab4f70f user: dan tags: vtab-onepass) | |
Changes
Changes to ext/fts3/fts3_write.c.
︙ | |||
870 871 872 873 874 875 876 | 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 | - + | /* TODO(shess) Explore whether partially flushing the buffer on ** forced-flush would provide better performance. I suspect that if ** we ordered the doclists by size and flushed the largest until the ** buffer was half empty, that would let the less frequent terms ** generate longer doclists. */ if( iDocid<p->iPrevDocid |
︙ |
Changes to src/update.c.
︙ | |||
296 297 298 299 300 301 302 | 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 | - - - - - - - - - - - + - - - - - - - - - - - + + + + + + + + + + + + | /* Begin generating code. */ v = sqlite3GetVdbe(pParse); if( v==0 ) goto update_cleanup; if( pParse->nested==0 ) sqlite3VdbeCountChanges(v); sqlite3BeginWriteOperation(pParse, 1, iDb); |
︙ | |||
340 341 342 343 344 345 346 347 348 349 350 351 352 353 | 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 | + + + + + + + + + | /* Resolve the column names in all the expressions in the ** WHERE clause. */ if( sqlite3ResolveExprNames(&sNC, pWhere) ){ goto update_cleanup; } #ifndef SQLITE_OMIT_VIRTUALTABLE /* Virtual tables must be handled separately */ if( IsVirtual(pTab) ){ updateVirtualTable(pParse, pTabList, pTab, pChanges, pRowidExpr, aXRef, pWhere, onError); goto update_cleanup; } #endif /* Begin the database scan */ if( HasRowid(pTab) ){ sqlite3VdbeAddOp3(v, OP_Null, 0, regRowSet, regOldRowid); pWInfo = sqlite3WhereBegin( pParse, pTabList, pWhere, 0, 0, WHERE_ONEPASS_DESIRED, iIdxCur |
︙ | |||
681 682 683 684 685 686 687 | 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 | + + + + - + - + - + - - - + + - + - - + - - - - - - - + - - + + - - - + + - - + + - - - - - - - - + + + + - - - - - - + + + - + + + + + - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + + + - + + + + - - - - + + + + - - | #undef pTrigger #endif #ifndef SQLITE_OMIT_VIRTUALTABLE /* ** Generate code for an UPDATE of a virtual table. ** ** There are two possible strategies - the default and the special ** "onepass" strategy. Onepass is only used if the virtual table ** implementation indicates that pWhere may match at most one row. ** |
Changes to test/fts3conf.test.
︙ | |||
82 83 84 85 86 87 88 | 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | - - - - - + + + + + | 6 "INSERT OR ROLLBACK $T2" 1 1 {{a b c d} {e f g h}} 7 "INSERT OR ABORT $T2" 1 1 {{a b c d} {e f g h} {i j k l}} 8 "INSERT OR FAIL $T2" 1 1 {{a b c d} {e f g h} {i j k l} z} 9 "INSERT OR IGNORE $T2" 1 0 {{a b c d} {e f g h} {i j k l} z} 10 "INSERT OR REPLACE $T2" 1 0 {{a b c d} y {i j k l} z} |
︙ |
Changes to test/fts4growth.test.
︙ | |||
198 199 200 201 202 203 204 | 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 | - + - + | } {0} do_test 3.1.3 { db transaction { insert_doc 1 2 3 4 5 6 7 8 9 delete_doc 9 8 7 } execsql { SELECT level, idx, second(end_block) FROM x3_segdir } |
︙ |