/ Check-in [d227de8a]
Login

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

Overview
Comment:Fix the covering index OR optimization (check-in [fcbd6abd]) so that it works with SQLITE_MAX_ATTACHED>30. Broken by a bad cherry-pick merge.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | branch-3.8.9
Files: files | file ages | folders
SHA3-256: d227de8ad9cf757f30f5415ca8fccff3b5959621d09244bd1f444d3282c5b2ef
User & Date: drh 2017-07-08 01:01:08
Context
2017-07-17
19:37
Try to push relevant WHERE clause terms of the outer query down into the subquery in order to help the subquery run faster and/or use less memory. This is a cherry-pick of [6df18e949d36] with bug fixes. check-in: cd6ac078 user: drh tags: branch-3.8.9
19:07
For FROM-clause subqueries that cannot be flattened, try to push relevant WHERE clause terms of the outer query down into the subquery in order to help the subquery run faster and/or use less memory. Cherry-pick from [6df18e949d36]. Still need to backport bug fixes associated with that check-in. check-in: 043d6ce8 user: drh tags: push-down-backport
2017-07-08
01:01
Fix the covering index OR optimization (check-in [fcbd6abd]) so that it works with SQLITE_MAX_ATTACHED>30. Broken by a bad cherry-pick merge. check-in: d227de8a user: drh tags: branch-3.8.9
2017-07-05
16:20
Make use of covering indexes in the OR optimization. check-in: fcbd6abd user: drh tags: branch-3.8.9
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/where.c.

3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
  Vdbe *v = pParse->pVdbe;        /* Vdbe to generate code within */

  assert( iIdxCur>0 );
  assert( pIdx->aiColumn[pIdx->nColumn-1]==-1 );
  
  sqlite3VdbeAddOp3(v, OP_Seek, iCur, iRowid, iIdxCur);
  if( (pWInfo->wctrlFlags & WHERE_FORCE_TABLE)
   && sqlite3ParseToplevel(pParse)->writeMask==0 
  ){
    int i;
    Table *pTab = pIdx->pTable;
    int *ai = (int*)sqlite3DbMallocZero(pParse->db, sizeof(int)*(pTab->nCol+1));
    if( ai ){
      ai[0] = pTab->nCol;
      for(i=0; i<pIdx->nColumn-1; i++){







|







3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
  Vdbe *v = pParse->pVdbe;        /* Vdbe to generate code within */

  assert( iIdxCur>0 );
  assert( pIdx->aiColumn[pIdx->nColumn-1]==-1 );
  
  sqlite3VdbeAddOp3(v, OP_Seek, iCur, iRowid, iIdxCur);
  if( (pWInfo->wctrlFlags & WHERE_FORCE_TABLE)
   && DbMaskAllZero(sqlite3ParseToplevel(pParse)->writeMask)
  ){
    int i;
    Table *pTab = pIdx->pTable;
    int *ai = (int*)sqlite3DbMallocZero(pParse->db, sizeof(int)*(pTab->nCol+1));
    if( ai ){
      ai[0] = pTab->nCol;
      for(i=0; i<pIdx->nColumn-1; i++){