/ Check-in [d2fb7619]
Login

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

Overview
Comment:Remove an unreachable branch. Improvements to comments.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | vtab-IN-opt
Files: files | file ages | folders
SHA1:d2fb7619b063b329b6d7ba9a16a7290e5d868f23
User & Date: drh 2012-12-14 17:48:08
Context
2012-12-14
17:54
Optimize IN operators in the WHERE clause of queries using virtual tables. check-in: 3d65c703 user: drh tags: trunk
17:48
Remove an unreachable branch. Improvements to comments. Closed-Leaf check-in: d2fb7619 user: drh tags: vtab-IN-opt
15:54
Merge in all the trunk changes that have occurred since this branch was opened. check-in: 6d507e4d user: drh tags: vtab-IN-opt
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/where.c.

2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253


2254
2255


2256
2257
2258
2259
2260
2261
2262
  ** be a pointer to an sqlite3_vtab structure. Otherwise
  ** sqlite3ViewGetColumnNames() would have picked up the error. 
  */
  assert( pTab->azModuleArg && pTab->azModuleArg[0] );
  assert( sqlite3GetVTable(pParse->db, pTab) );

  /* Try once or twice.  On the first attempt, allow IN optimizations.
  ** If an IN optimization is accepted, but does not set the
  ** pInfo->aConstrainUsage.omit flag, then it will not work (because it
  ** will allow duplicate rows in the result set) so try again with
  ** IN optimizations disabled.


  */
  for(bAllowIN=1; bAllowIN>=0; bAllowIN--){


    /* Set the aConstraint[].usable fields and initialize all 
    ** output variables to zero.
    **
    ** aConstraint[].usable is true for constraints where the right-hand
    ** side contains only references to tables to the left of the current
    ** table.  In other words, if the constraint is of the form:
    **







|
|
|
|
>
>

|
>
>







2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
  ** be a pointer to an sqlite3_vtab structure. Otherwise
  ** sqlite3ViewGetColumnNames() would have picked up the error. 
  */
  assert( pTab->azModuleArg && pTab->azModuleArg[0] );
  assert( sqlite3GetVTable(pParse->db, pTab) );

  /* Try once or twice.  On the first attempt, allow IN optimizations.
  ** If an IN optimization is accepted by the virtual table xBestIndex
  ** method, but the  pInfo->aConstrainUsage.omit flag is not set, then
  ** the query will not work because it might allow duplicate rows in
  ** output.  In that case, run the xBestIndex method a second time
  ** without the IN constraints.  Usually this loop only runs once.
  ** The loop will exit using a "break" statement.
  */
  for(bAllowIN=1; 1; bAllowIN--){
    assert( bAllowIN==0 || bAllowIN==1 );

    /* Set the aConstraint[].usable fields and initialize all 
    ** output variables to zero.
    **
    ** aConstraint[].usable is true for constraints where the right-hand
    ** side contains only references to tables to the left of the current
    ** table.  In other words, if the constraint is of the form:
    **