Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Cherrypick of [c1152bdcbb] and fix for [9f2eb3abac]: Have the whereShortCut() planner ignore indexes with more than four columns. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | branch-3.8.0 |
Files: | files | file ages | folders |
SHA1: |
c3f75941e5dbd927142efb68e7c31904 |
User & Date: | drh 2013-08-29 13:15:09.214 |
Context
2013-08-29
| ||
13:21 | In the query optimizer, when converting BETWEEN and LIKE/GLOB expressions into simpler forms for processing, be sure to transfer the LEFT JOIN markings. Fix for ticket [bc878246eafe0f52c]. Cherrypick of [caab361ebe]. (check-in: cb667449d0 user: drh tags: branch-3.8.0) | |
13:15 | Cherrypick of [c1152bdcbb] and fix for [9f2eb3abac]: Have the whereShortCut() planner ignore indexes with more than four columns. (check-in: c3f75941e5 user: drh tags: branch-3.8.0) | |
10:46 | Candidate fix for [9f2eb3abac]: Have the whereShortCut() planner ignore indexes with more than four columns. (check-in: c1152bdcbb user: dan tags: trunk) | |
2013-08-26
| ||
04:50 | Version 3.8.0 (check-in: f64cd21e2e user: drh tags: trunk, release, version-3.8.0) | |
Changes
Changes to src/where.c.
︙ | ︙ | |||
5542 5543 5544 5545 5546 5547 5548 | pLoop->aLTerm[0] = pTerm; pLoop->nLTerm = 1; pLoop->u.btree.nEq = 1; /* TUNING: Cost of a rowid lookup is 10 */ pLoop->rRun = 33; /* 33==whereCost(10) */ }else{ for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ | > > | > > > < | 5542 5543 5544 5545 5546 5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 5557 5558 5559 5560 5561 5562 5563 5564 | pLoop->aLTerm[0] = pTerm; pLoop->nLTerm = 1; pLoop->u.btree.nEq = 1; /* TUNING: Cost of a rowid lookup is 10 */ pLoop->rRun = 33; /* 33==whereCost(10) */ }else{ for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ assert( pLoop->aLTermSpace==pLoop->aLTerm ); assert( ArraySize(pLoop->aLTermSpace)==4 ); if( pIdx->onError==OE_None || pIdx->pPartIdxWhere!=0 || pIdx->nColumn>ArraySize(pLoop->aLTermSpace) ) continue; for(j=0; j<pIdx->nColumn; j++){ pTerm = findTerm(pWC, iCur, pIdx->aiColumn[j], 0, WO_EQ, pIdx); if( pTerm==0 ) break; pLoop->aLTerm[j] = pTerm; } if( j!=pIdx->nColumn ) continue; pLoop->wsFlags = WHERE_COLUMN_EQ|WHERE_ONEROW|WHERE_INDEXED; if( (pItem->colUsed & ~columnsInIndex(pIdx))==0 ){ pLoop->wsFlags |= WHERE_IDX_ONLY; } |
︙ | ︙ |
Added test/tkt-9f2eb3abac.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 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 | # 2013 August 29 # # 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. # #*********************************************************************** # This file implements regression tests for SQLite library. # set testdir [file dirname $argv0] source $testdir/tester.tcl source $testdir/malloc_common.tcl set ::testprefix tkt-9f2eb3abac do_execsql_test 1.1 { CREATE TABLE t1(a,b,c,d,e, PRIMARY KEY(a,b,c,d,e)); SELECT * FROM t1 WHERE a=? AND b=? AND c=? AND d=? AND e=?; } {} do_execsql_test 1.2 { CREATE TABLE "a" ( "b" integer NOT NULL, "c" integer NOT NULL, PRIMARY KEY ("b", "c") ); CREATE TABLE "d" ( "e" integer NOT NULL, "g" integer NOT NULL, "f" integer NOT NULL, "h" integer NOT NULL, "i" character(10) NOT NULL, "j" int, PRIMARY KEY ("e", "g", "f", "h") ); CREATE TABLE "d_to_a" ( "f_e" integer NOT NULL, "f_g" integer NOT NULL, "f_f" integer NOT NULL, "f_h" integer NOT NULL, "t_b" integer NOT NULL, "t_c" integer NOT NULL, "r" character NOT NULL, "s" integer, PRIMARY KEY ("f_e", "f_g", "f_f", "f_h", "t_b", "t_c") ); INSERT INTO d (g, e, h, f, j, i) VALUES ( 1, 1, 1, 1, 1, 1 ); INSERT INTO a (b, c) VALUES ( 1, 1 ); INSERT INTO d_to_a VALUES (1, 1, 1, 1, 1, 1, 1, 1); DELETE FROM d_to_a WHERE f_g = 1 AND f_e = 1 AND f_h = 1 AND f_f = 1 AND t_b = 1 AND t_c = 1; SELECT * FROM d_to_a; } {} faultsim_delete_and_reopen do_execsql_test 2.0 { CREATE TABLE t1(a,b,c,d,e, PRIMARY KEY(a,b,c,d,e)) } do_execsql_test 2.1 { CREATE TABLE t2(x) } faultsim_save_and_close do_faultsim_test 3 -faults oom* -prep { faultsim_restore_and_reopen execsql { SELECT 1 FROM sqlite_master } } -body { execsql { SELECT * FROM t1,t2 WHERE a=? AND b=? AND c=? AND d=? AND e=? } } -test { faultsim_test_result {0 {}} } finish_test |