Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch analyze-worst-case Excluding Merge-Ins
This is equivalent to a diff from cb9302cc to c4488730
2016-03-04
| ||
21:18 | Fix an assert() in sqlite3VarintLen(), even though it is impossible to hit in SQLite due to the way sqlite3VarintLen() is used. (check-in: 251424c5 user: drh tags: trunk) | |
19:55 | Simplify the computation of Index.aAvgEq. (Leaf check-in: c4488730 user: drh tags: analyze-worst-case) | |
18:45 | Merge changes from trunk. (check-in: 5294c977 user: drh tags: analyze-worst-case) | |
16:42 | Merge recent enhancements from trunk. Default page size is 4096. Writes to statement journals are avoided. (check-in: 456df336 user: drh tags: sessions) | |
14:57 | Merge recent enhancements from trunk, and especially the changes that reduce the heap-memory footprint of schemas, and defer opening and writing to statement journals. (check-in: 2f0c195c user: drh tags: apple-osx) | |
14:43 | Defer opening and writing statement journals until the size reaches a threshold (currently 64KiB). (check-in: cb9302cc user: drh tags: trunk) | |
14:23 | Update test cases to taken deferred statement-journal opening into account. (Closed-Leaf check-in: 5b2fe521 user: drh tags: memjournal-exp) | |
04:01 | Change the default cache_size to -2000 (which means 2000*1024 bytes independent of page_size). (check-in: 2682e8e4 user: drh tags: trunk) | |
Changes to src/analyze.c.
︙ | |||
263 264 265 266 267 268 269 270 271 272 273 274 275 276 | 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 | + | ** information. */ typedef struct Stat4Accum Stat4Accum; typedef struct Stat4Sample Stat4Sample; struct Stat4Sample { tRowcnt *anEq; /* sqlite_stat4.nEq */ tRowcnt *anDLt; /* sqlite_stat4.nDLt */ tRowcnt *amxEq; /* Maximum length run of equal values */ #ifdef SQLITE_ENABLE_STAT3_OR_STAT4 tRowcnt *anLt; /* sqlite_stat4.nLt */ union { i64 iRowid; /* Rowid in main table of the key */ u8 *aRowid; /* Key for WITHOUT ROWID tables */ } u; u32 nRowid; /* Sizeof aRowid[] */ |
︙ | |||
414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 | 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 | + - - + + + - + - + | nKeyCol = sqlite3_value_int(argv[1]); assert( nKeyCol<=nCol ); assert( nKeyCol>0 ); /* Allocate the space required for the Stat4Accum object */ n = sizeof(*p) + sizeof(tRowcnt)*nColUp /* Stat4Accum.anEq */ + sizeof(tRowcnt)*nColUp /* Stat4Accum.amxEq */ + sizeof(tRowcnt)*nColUp /* Stat4Accum.anDLt */ #ifdef SQLITE_ENABLE_STAT3_OR_STAT4 + sizeof(tRowcnt)*nColUp /* Stat4Accum.anLt */ + sizeof(Stat4Sample)*(nCol+mxSample) /* Stat4Accum.aBest[], a[] */ + sizeof(tRowcnt)*3*nColUp*(nCol+mxSample) #endif ; db = sqlite3_context_db_handle(context); p = sqlite3DbMallocZero(db, n); if( p==0 ){ sqlite3_result_error_nomem(context); return; } p->db = db; p->nRow = 0; p->nCol = nCol; p->nKeyCol = nKeyCol; |
︙ | |||
717 718 719 720 721 722 723 | 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 | - + + + + + | UNUSED_PARAMETER( argc ); UNUSED_PARAMETER( context ); assert( p->nCol>0 ); assert( iChng<p->nCol ); if( p->nRow==0 ){ /* This is the first call to this function. Do initialization. */ |
︙ | |||
817 818 819 820 821 822 823 | 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 | - + - - - - - - + + + + + + + - - - - + + + + - - + + + - + + + + + + + + + + + + + + + + + + + + + - + - - + + + + + + - + - - + + | || eCall==STAT_GET_NDLT ); if( eCall==STAT_GET_STAT1 ) #else assert( argc==1 ); #endif { |
︙ | |||
1567 1568 1569 1570 1571 1572 1573 | 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 | + + - - - + + + - - + - + - + - + - - + + - + - - - - + - - - - - - + - - - + + - + - - + + + | #ifdef SQLITE_ENABLE_STAT3_OR_STAT4 /* ** Populate the pIdx->aAvgEq[] array based on the samples currently ** stored in pIdx->aSample[]. */ static void initAvgEq(Index *pIdx){ if( pIdx ){ int nSample = pIdx->nSample; /* Number of samples */ int nCol = pIdx->nSampleCol; /* Number of columns sampled */ |
︙ |
Changes to src/sqliteInt.h.
︙ | |||
2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 | 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 | + + + + + + + + + | #define JT_CROSS 0x0002 /* Explicit use of the CROSS keyword */ #define JT_NATURAL 0x0004 /* True for a "natural" join */ #define JT_LEFT 0x0008 /* Left outer join */ #define JT_RIGHT 0x0010 /* Right outer join */ #define JT_OUTER 0x0020 /* The "OUTER" keyword is present */ #define JT_ERROR 0x0040 /* unknown or unsupported join type */ /* ** TUNING: The skip-scan optimization is only profitable if the average ** number of repeats of an entry in the index is greater than or equal to ** WHERE_SKIPSCAN_ONSET. If the average numbe of repeats is less ** than WHERE_SKIPSCAN_ONSET, then it is faster to do a full table ** scan. */ #define WHERE_SKIPSCAN_ONSET 18 #define WHERE_SKIPSCAN_ONSET_LOG 42 /* ** Flags appropriate for the wctrlFlags parameter of sqlite3WhereBegin() ** and the WhereInfo.wctrlFlags member. */ #define WHERE_ORDERBY_NORMAL 0x0000 /* No-op */ #define WHERE_ORDERBY_MIN 0x0001 /* ORDER BY processing for min() func */ |
︙ |
Changes to src/where.c.
︙ | |||
2408 2409 2410 2411 2412 2413 2414 | 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 | - + - + | ** ** The magic number 18 is selected on the basis that scanning 17 rows ** is almost always quicker than an index seek (even though if the index ** contains fewer than 2^17 rows we assume otherwise in other parts of ** the code). And, even if it is not, it should not be too much slower. ** On the other hand, the extra seeks could end up being significantly ** more expensive. */ |
︙ |
Changes to test/skipscan2.test.
︙ | |||
44 45 46 47 48 49 50 | 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 | - - - - - - - - + + - + - - + + - + - - + + - + - + - + - - - + + + - + - - - - - - - - + - + - + - + - - - - - - - - - - - - - - - - - - - - - + + - - + + - + - + - + - - + + - - + + | INSERT INTO people VALUES('Nathan','student',163); INSERT INTO people VALUES('Olivia','student',161); INSERT INTO people VALUES('Patrick','teacher',180); INSERT INTO people VALUES('Quiana','student',182); INSERT INTO people VALUES('Robert','student',159); INSERT INTO people VALUES('Sally','student',166); INSERT INTO people VALUES('Tom','student',171); |
︙ |