Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch autoindex-improvements Excluding Merge-Ins
This is equivalent to a diff from fc918f7d33 to 4ece839d44
2014-06-18
| ||
15:11 | Prevent an automatic index from taking the place of a declared index. (check-in: 0a52bddd9d user: drh tags: trunk) | |
2014-06-17
| ||
20:16 | Prevent an automatic index from taking the place of a declared index. (Closed-Leaf check-in: 4ece839d44 user: drh tags: autoindex-improvements) | |
15:53 | Improvements to query planning, especially in regards to estimating the cost and benefit of automatic indexes. (check-in: 1272fb8991 user: drh tags: trunk) | |
13:23 | Add the autoindex2.test testing module. (check-in: ffe3fea47b user: drh tags: autoindex-improvements) | |
02:46 | Do not attempt to create an automatic index on a constant constraint, as doing so is pointless. (check-in: d6883e960f user: drh tags: autoindex-improvements) | |
2014-06-16
| ||
22:45 | Fix CSV import issue, reported via the mailing list, in the shell when the file to be imported ends with an empty line. (check-in: fc918f7d33 user: mistachkin tags: trunk) | |
21:30 | In the "wheretrace" logic (disabled for normal builds) expand the print width of the flags field to be wide enough for all 17 bits. (check-in: 3181d2069a user: drh tags: trunk) | |
Changes to ext/rtree/rtree6.test.
︙ | |||
88 89 90 91 92 93 94 | 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 | - + + + + + + + | do_eqp_test rtree6.2.3 { SELECT * FROM t1,t2 WHERE k=ii } { 0 0 0 {SCAN TABLE t1 VIRTUAL TABLE INDEX 2:} 0 1 1 {SEARCH TABLE t2 USING INTEGER PRIMARY KEY (rowid=?)} } |
︙ |
Changes to src/where.c.
︙ | |||
3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 | 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 | + + + + + + + + + + + | assert( p->rSetup==0 || pTemplate->rSetup==0 || p->rSetup==pTemplate->rSetup ); /* whereLoopAddBtree() always generates and inserts the automatic index ** case first. Hence compatible candidate WhereLoops never have a larger ** rSetup. Call this SETUP-INVARIANT */ assert( p->rSetup>=pTemplate->rSetup ); /* Any loop using an appliation-defined index (or PRIMARY KEY or ** UNIQUE constraint) with one or more == constraints is better ** than an automatic index. */ if( (p->wsFlags & WHERE_AUTO_INDEX)!=0 && (pTemplate->wsFlags & WHERE_INDEXED)!=0 && (pTemplate->wsFlags & WHERE_COLUMN_EQ)!=0 && (p->prereq & pTemplate->prereq)==pTemplate->prereq ){ break; } /* If existing WhereLoop p is better than pTemplate, pTemplate can be ** discarded. WhereLoop p is better if: ** (1) p has no more dependencies than pTemplate, and ** (2) p has an equal or lower cost than pTemplate */ if( (p->prereq & pTemplate->prereq)==p->prereq /* (1) */ |
︙ | |||
4043 4044 4045 4046 4047 4048 4049 | 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 | - + | /* We will be overwriting WhereLoop p[]. But before we do, first ** go through the rest of the list and delete any other entries besides ** p[] that are also supplated by pTemplate */ WhereLoop **ppTail = &p->pNextLoop; WhereLoop *pToDel; while( *ppTail ){ ppTail = whereLoopFindLesser(ppTail, pTemplate); |
︙ | |||
5274 5275 5276 5277 5278 5279 5280 | 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298 | - | int iLoop; /* Loop counter over the terms of the join */ int ii, jj; /* Loop counters */ int mxI = 0; /* Index of next entry to replace */ int nOrderBy; /* Number of ORDER BY clause terms */ LogEst rCost; /* Cost of a path */ LogEst nOut; /* Number of outputs */ LogEst mxCost = 0; /* Maximum cost of a set of paths */ |
︙ | |||
5384 5385 5386 5387 5388 5389 5390 | 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 | - - | }else{ revMask = pFrom->revLoop; } /* Check to see if pWLoop should be added to the mxChoice best so far */ for(jj=0, pTo=aTo; jj<nTo; jj++, pTo++){ if( pTo->maskLoop==maskNew && ((pTo->isOrdered^isOrdered)&80)==0 |
︙ | |||
5419 5420 5421 5422 5423 5424 5425 | 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 | - + | if( sqlite3WhereTrace&0x4 ){ sqlite3DebugPrintf("New %s cost=%-3d,%3d order=%c\n", wherePathName(pFrom, iLoop, pWLoop), rCost, nOut, isOrdered>=0 ? isOrdered+'0' : '?'); } #endif }else{ |
︙ | |||
5459 5460 5461 5462 5463 5464 5465 | 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5478 5479 5480 5481 5482 5483 | - - + - | pTo->rCost = rCost; pTo->isOrdered = isOrdered; memcpy(pTo->aLoop, pFrom->aLoop, sizeof(WhereLoop*)*iLoop); pTo->aLoop[iLoop] = pWLoop; if( nTo>=mxChoice ){ mxI = 0; mxCost = aTo[0].rCost; |
︙ |
Added test/autoindex2.test.