/ Check-in [707690c5]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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

Overview
Comment:add comment that table is accessed by primary key (CVS 2177)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 707690c5f2e1340bbbb4cb06e6b2b76a2a3b5f0d
User & Date: tpoindex 2005-01-03 18:13:18
Context
2005-01-03
21:28
add --enable-debug to configure options, controls -DNDEBUG flag (CVS 2178) check-in: 9d674d1d user: tpoindex tags: trunk
18:13
add comment that table is accessed by primary key (CVS 2177) check-in: 707690c5 user: tpoindex tags: trunk
02:26
Allow GROUP BY on aggregate queries only. Ticket #1039. (CVS 2176) check-in: 8ef2c644 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/where.c.

    12     12   ** This module contains C code that generates VDBE code used to process
    13     13   ** the WHERE clause of SQL statements.  This module is reponsible for
    14     14   ** generating the code that loops through a table looking for applicable
    15     15   ** rows.  Indices are selected and used to speed the search when doing
    16     16   ** so is applicable.  Because this module is responsible for selecting
    17     17   ** indices, you might also think of this module as the "query optimizer".
    18     18   **
    19         -** $Id: where.c,v 1.126 2005/01/03 01:28:51 drh Exp $
           19  +** $Id: where.c,v 1.127 2005/01/03 18:13:18 tpoindex Exp $
    20     20   */
    21     21   #include "sqliteInt.h"
    22     22   
    23     23   /*
    24     24   ** The query generator uses an array of instances of this structure to
    25     25   ** help it analyze the subexpressions of the WHERE clause.  Each WHERE
    26     26   ** clause subexpression is separated from the others by an AND operator.
................................................................................
   991    991         assert( pTerm->idxLeft==iCur );
   992    992         assert( omitTable==0 );
   993    993         brk = pLevel->brk = sqlite3VdbeMakeLabel(v);
   994    994         codeEqualityTerm(pParse, pTerm, brk, pLevel);
   995    995         cont = pLevel->cont = sqlite3VdbeMakeLabel(v);
   996    996         sqlite3VdbeAddOp(v, OP_MustBeInt, 1, brk);
   997    997         sqlite3VdbeAddOp(v, OP_NotExists, iCur, brk);
          998  +      VdbeComment((v, "pk"));
   998    999         pLevel->op = OP_Noop;
   999   1000       }else if( pIdx!=0 && pLevel->score>3 && (pLevel->score&0x0c)==0 ){
  1000   1001         /* Case 2:  There is an index and all terms of the WHERE clause that
  1001   1002         **          refer to the index using the "==" or "IN" operators.
  1002   1003         */
  1003   1004         int start;
  1004   1005         int nColumn = (pLevel->score+16)/32;
................................................................................
  1076   1077           pTerm = &aExpr[k];
  1077   1078           pX = pTerm->p;
  1078   1079           assert( pX!=0 );
  1079   1080           assert( pTerm->idxLeft==iCur );
  1080   1081           sqlite3ExprCode(pParse, pX->pRight);
  1081   1082           sqlite3VdbeAddOp(v, OP_ForceInt, pX->op==TK_LT || pX->op==TK_GT, brk);
  1082   1083           sqlite3VdbeAddOp(v, bRev ? OP_MoveLt : OP_MoveGe, iCur, brk);
         1084  +        VdbeComment((v, "pk"));
  1083   1085           disableTerm(pLevel, &pTerm->p);
  1084   1086         }else{
  1085   1087           sqlite3VdbeAddOp(v, bRev ? OP_Last : OP_Rewind, iCur, brk);
  1086   1088         }
  1087   1089         if( iDirectLt[i]>=0 ){
  1088   1090           Expr *pX;
  1089   1091           k = iDirectLt[i];