Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch exp-avoid-expensive-skipscan Excluding Merge-Ins
This is equivalent to a diff from 5a12db75 to 32924446
2018-07-10
| ||
15:55 | Experimental planner change to avoid a skip-scan if a regular index scan on the same index columns can be done instead. (Leaf check-in: 350f29ea user: dan tags: exp-begin-concurrent-pnu) | |
2018-07-05
| ||
17:16 | In wal mode, if a "BEGIN EXCLUSIVE" command (or any other command that upgrades from no transaction directly to a write transaction) hits an SQLITE_BUSY_SNAPSHOT error, change the error code to SQLITE_BUSY to indicate to the caller that the condition may be transient. (check-in: e6108047 user: dan tags: trunk) | |
15:46 | In wal mode, if a "BEGIN EXCLUSIVE" command (or any other command that upgrades from no transaction directly to a write transaction) hits an SQLITE_BUSY_SNAPSHOT error, change the error code to SQLITE_BUSY to indicate to the caller that the condition may be transient. (check-in: 221ff63e user: dan tags: exp-busy-snapshot-fix) | |
2018-07-04
| ||
14:28 | Experimental planner change to avoid a skip-scan if a regular index scan on the same index columns can be done instead. (Leaf check-in: 32924446 user: dan tags: exp-avoid-expensive-skipscan) | |
2018-07-03
| ||
20:17 | Test that a race condition can cause a "BEGIN EXCLUSIVE" to return SQLITE_BUSY_SNAPSHOT in wal mode. (check-in: 5a12db75 user: dan tags: trunk) | |
2018-07-02
| ||
17:45 | Fix a problem in the xInverse callback for the built-in sum() window function. (check-in: b6563647 user: dan tags: trunk) | |
Changes to src/where.c.
︙ | ︙ | |||
2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 | if( (p->prereq & pTemplate->prereq)==p->prereq /* (1) */ && p->rSetup<=pTemplate->rSetup /* (2a) */ && p->rRun<=pTemplate->rRun /* (2b) */ && p->nOut<=pTemplate->nOut /* (2c) */ ){ return 0; /* Discard pTemplate */ } /* If pTemplate is always better than p, then cause p to be overwritten ** with pTemplate. pTemplate is better than p if: ** (1) pTemplate has no more dependences than p, and ** (2) pTemplate has an equal or lower cost than p. */ if( (p->prereq & pTemplate->prereq)==pTemplate->prereq /* (1) */ | > > > > > > > > > > > > > > > > > > > > > > > | 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 | if( (p->prereq & pTemplate->prereq)==p->prereq /* (1) */ && p->rSetup<=pTemplate->rSetup /* (2a) */ && p->rRun<=pTemplate->rRun /* (2b) */ && p->nOut<=pTemplate->nOut /* (2c) */ ){ return 0; /* Discard pTemplate */ } /* If pTemplate: ** ** (1) uses the same index as existing where-loop p, ** (2) requires the same or a superset of tables to be scanned first, ** (3) constraints the same or fewer columns with ==, and ** (4) skips more leading columns (skip-scan optimization). ** ** the discard the template. This ensures that if stat4 data shows that: ** ** WHERE (a=1 AND b=2) ** ** is prohibitively expensive the planner does not instead do: ** ** WHERE (ANY(a) AND b=2) */ if( pTemplate->nSkip>p->nSkip /* (4) */ && pTemplate->u.btree.pIndex==p->u.btree.pIndex /* (1) */ && pTemplate->u.btree.nEq<=p->u.btree.nEq /* (3) */ && (pTemplate->prereq & p->prereq)==p->prereq /* (2) */ ){ return 0; /* Discard pTemplate */ } /* If pTemplate is always better than p, then cause p to be overwritten ** with pTemplate. pTemplate is better than p if: ** (1) pTemplate has no more dependences than p, and ** (2) pTemplate has an equal or lower cost than p. */ if( (p->prereq & pTemplate->prereq)==pTemplate->prereq /* (1) */ |
︙ | ︙ |
Added test/analyzeG.test.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | # 2018-07-04 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # set testdir [file dirname $argv0] source $testdir/tester.tcl set ::testprefix analyzeG ifcapable {!stat4} { finish_test return } do_execsql_test 1.0 { CREATE TABLE t1(a, b, c, d); CREATE INDEX t1abc ON t1(a, b, c); WITH s(i) AS ( SELECT 1 UNION ALL SELECT i+1 FROM s WHERE i<100000 ) INSERT INTO t1 SELECT 1,1,1,1 FROM s; WITH s(i) AS ( SELECT 1 UNION ALL SELECT i+1 FROM s WHERE i<1000 ) INSERT INTO t1 SELECT i%5,i,i,i FROM s; } do_execsql_test 1.1 { EXPLAIN QUERY PLAN SELECT * FROM t1 WHERE a=1 AND b=1 AND c>0 } { 3 0 0 {SEARCH TABLE t1 USING INDEX t1abc (a=? AND b=? AND c>?)} } do_execsql_test 1.3 { ANALYZE } {} do_execsql_test 1.4 { EXPLAIN QUERY PLAN SELECT * FROM t1 WHERE a=1 AND b=1 AND c>0 } { 2 0 0 {SCAN TABLE t1} } finish_test |