/ Check-in [cecc5fdd]
Login

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

Overview
Comment:Comment tweaks in where.c. No changes to code.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | nextgen-query-plan-exp
Files: files | file ages | folders
SHA1:cecc5fdd5d8fbad7d9e8c275b9ba9ade3dbee8ef
User & Date: drh 2013-06-14 13:27:01
Context
2013-06-15
15:11
Fix compiler warnings. check-in: 3e8ac469 user: drh tags: nextgen-query-plan-exp
2013-06-14
13:27
Comment tweaks in where.c. No changes to code. check-in: cecc5fdd user: drh tags: nextgen-query-plan-exp
02:51
Add a new ORDER BY optimization that bypasses ORDER BY terms that are constrained by == and IS NULL terms of the WHERE clause. check-in: b920bb70 user: drh tags: nextgen-query-plan-exp
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/where.c.

    61     61   ** that will convert between WhereCost to integers and do addition and
    62     62   ** multiplication on WhereCost values.  That command-line program is a
    63     63   ** useful utility to have around when working with this module.
    64     64   */
    65     65   typedef unsigned short int WhereCost;
    66     66   
    67     67   /*
    68         -** This object contains information needed to implement a single nestd
           68  +** This object contains information needed to implement a single nested
    69     69   ** loop in WHERE clause.
    70     70   **
    71     71   ** Contrast this object with WhereLoop.  This object describes the
    72     72   ** implementation of the loop.  WhereLoop describes the algorithm.
    73     73   ** This object contains a pointer to the WhereLoop algorithm as one of
    74     74   ** its elements.
    75     75   **
................................................................................
  5940   5940           sqlite3VdbeAddOp1(v, OP_Close, pTabItem->iCursor);
  5941   5941         }
  5942   5942         if( (ws & WHERE_INDEXED)!=0 && (ws & (WHERE_IPK|WHERE_TEMP_INDEX))==0 ){
  5943   5943           sqlite3VdbeAddOp1(v, OP_Close, pLevel->iIdxCur);
  5944   5944         }
  5945   5945       }
  5946   5946   
  5947         -    /* If this scan uses an index, make code substitutions to read data
  5948         -    ** from the index in preference to the table. Sometimes, this means
  5949         -    ** the table need never be read from. This is a performance boost,
  5950         -    ** as the vdbe level waits until the table is read before actually
  5951         -    ** seeking the table cursor to the record corresponding to the current
  5952         -    ** position in the index.
         5947  +    /* If this scan uses an index, make VDBE code substitutions to read data
         5948  +    ** from the index instead of from the table where possible.  In some cases
         5949  +    ** this optimization prevents the table from ever being read, which can
         5950  +    ** yield a significant performance boost.
  5953   5951       ** 
  5954   5952       ** Calls to the code generator in between sqlite3WhereBegin and
  5955   5953       ** sqlite3WhereEnd will have created code that references the table
  5956   5954       ** directly.  This loop scans all that code looking for opcodes
  5957   5955       ** that reference the table and converts them into opcodes that
  5958   5956       ** reference the index.
  5959   5957       */