aboutsummaryrefslogtreecommitdiff
path: root/src/wherecode.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2018-05-30 00:54:23 +0000
committerdrh <drh@noemail.net>2018-05-30 00:54:23 +0000
commita0368d9396ea3c8cb80f902cacb7594039909bb2 (patch)
tree0af5c0f2f2ea85760987c67c7123638b178a167a /src/wherecode.c
parentea93e2804d46ae1279c7112505eab55579b40dc9 (diff)
downloadsqlite-a0368d9396ea3c8cb80f902cacb7594039909bb2.tar.gz
sqlite-a0368d9396ea3c8cb80f902cacb7594039909bb2.zip
Demonstration code on a possible technique for optimizing the use of IN
operator on columns to the right of multicolumn indexes. If the OP_Noop generated where were really a new opcode that checked to see if there existed any entries in the index with a matching prefix, it might prevent unnecessary iterations of the IN operator. FossilOrigin-Name: 92f0fe155d5546fc7f4a443d0630613dabe149061966308e5420fad652278f16
Diffstat (limited to 'src/wherecode.c')
-rw-r--r--src/wherecode.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/wherecode.c b/src/wherecode.c
index c9edab7b0..157812247 100644
--- a/src/wherecode.c
+++ b/src/wherecode.c
@@ -592,6 +592,8 @@ static int codeEqualityTerm(
if( i==iEq ){
pIn->iCur = iTab;
pIn->eEndLoopOp = bRev ? OP_PrevIfOpen : OP_NextIfOpen;
+ pIn->iBase = iReg - i;
+ pIn->nPrefix = i;
}else{
pIn->eEndLoopOp = OP_Noop;
}