/ Check-in [171aa833]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add an EXPLAIN QUERY PLAN line for when a index is used to implement an IN operator.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | rowvalue
Files: files | file ages | folders
SHA1: 171aa833a2e1650c3d9cf9bd6438ae46f6c35871
User & Date: drh 2016-08-26 19:54:12
Context
2016-08-26
21:15
Fix the sqlite3FindInIndex() to ensure that it always uses a prefix of the index and uses no repeated columns. Enhanced comments. check-in: b9fc89e4 user: drh tags: rowvalue
19:54
Add an EXPLAIN QUERY PLAN line for when a index is used to implement an IN operator. check-in: 171aa833 user: drh tags: rowvalue
19:47
Add test cases to rowvalue2.test. check-in: 078bb69e user: dan tags: rowvalue
Changes
Hide Diffs Unified Diffs Show Whitespace Changes Patch

Changes to src/expr.c.

2225
2226
2227
2228
2229
2230
2231





2232
2233
2234
2235
2236
2237
2238
          }
          if( j==nExpr ) break;
          if( aiMap ) aiMap[i] = j;
        }

        if( i==nExpr ){
          int iAddr = sqlite3CodeOnce(pParse); VdbeCoverage(v);





          sqlite3VdbeAddOp3(v, OP_OpenRead, iTab, pIdx->tnum, iDb);
          sqlite3VdbeSetP4KeyInfo(pParse, pIdx);
          VdbeComment((v, "%s", pIdx->zName));
          assert( IN_INDEX_INDEX_DESC == IN_INDEX_INDEX_ASC+1 );
          eType = IN_INDEX_INDEX_ASC + pIdx->aSortOrder[0];

          if( prRhsHasNull ){







>
>
>
>
>







2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
          }
          if( j==nExpr ) break;
          if( aiMap ) aiMap[i] = j;
        }

        if( i==nExpr ){
          int iAddr = sqlite3CodeOnce(pParse); VdbeCoverage(v);
#ifndef SQLITE_OMIT_EXPLAIN
          sqlite3VdbeAddOp4(v, OP_Explain, 0, 0, 0,
            sqlite3MPrintf(db, "USING INDEX %s FOR IN-OPERATOR", pIdx->zName),
            P4_DYNAMIC);
#endif
          sqlite3VdbeAddOp3(v, OP_OpenRead, iTab, pIdx->tnum, iDb);
          sqlite3VdbeSetP4KeyInfo(pParse, pIdx);
          VdbeComment((v, "%s", pIdx->zName));
          assert( IN_INDEX_INDEX_DESC == IN_INDEX_INDEX_ASC+1 );
          eType = IN_INDEX_INDEX_ASC + pIdx->aSortOrder[0];

          if( prRhsHasNull ){