/ Check-in [e8f12428]
Login

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

Overview
Comment:Use automatic indices on subqueries of the FROM clause when appropriate.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | nextgen-query-plan-exp
Files: files | file ages | folders
SHA1:e8f124284ee0d0e373dc4431668630f1e17015c1
User & Date: drh 2013-06-17 14:18:21
Context
2013-06-17
18:20
Simplifications to the NGQP. Add the queryplantest makefile target. Add testcase() macros in the NGQP. check-in: eaf1f1b4 user: drh tags: nextgen-query-plan-exp
14:18
Use automatic indices on subqueries of the FROM clause when appropriate. check-in: e8f12428 user: drh tags: nextgen-query-plan-exp
2013-06-15
15:11
Fix compiler warnings. check-in: 3e8ac469 user: drh tags: nextgen-query-plan-exp
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/where.c.

  5766   5766     }
  5767   5767   
  5768   5768     /* Open all tables in the pTabList and any indices selected for
  5769   5769     ** searching those tables.
  5770   5770     */
  5771   5771     sqlite3CodeVerifySchema(pParse, -1); /* Insert the cookie verifier Goto */
  5772   5772     notReady = ~(Bitmask)0;
  5773         -  pWInfo->nRowOut = (WhereCost)1;
  5774   5773     for(ii=0, pLevel=pWInfo->a; ii<nTabList; ii++, pLevel++){
  5775   5774       Table *pTab;     /* Table to open */
  5776   5775       int iDb;         /* Index of database containing table/index */
  5777   5776       struct SrcList_item *pTabItem;
  5778   5777       WhereLoop *pLoop;
  5779   5778   
  5780   5779       pTabItem = &pTabList->a[pLevel->iFrom];

Changes to test/autoindex1.test.

   247    247      ORDER BY x.registering_flock;
   248    248   } {
   249    249     1 0 0 {SCAN TABLE sheep AS s} 
   250    250     1 1 1 {SEARCH TABLE flock_owner AS prev USING INDEX sqlite_autoindex_flock_owner_1 (flock_no=? AND owner_change_date<?)} 
   251    251     1 0 0 {EXECUTE CORRELATED SCALAR SUBQUERY 2} 
   252    252     2 0 0 {SEARCH TABLE flock_owner AS later USING COVERING INDEX sqlite_autoindex_flock_owner_1 (flock_no=? AND owner_change_date>? AND owner_change_date<?)} 
   253    253     0 0 0 {SCAN TABLE sheep AS x USING INDEX sheep_reg_flock_index} 
   254         -  0 1 1 {SCAN SUBQUERY 1 AS y}
          254  +  0 1 1 {SEARCH SUBQUERY 1 AS y USING AUTOMATIC COVERING INDEX (sheep_no=?)}
   255    255   }
   256    256   
   257    257   
   258    258   do_execsql_test autoindex1-700 {
   259    259     CREATE TABLE t5(a, b, c);
   260    260     EXPLAIN QUERY PLAN SELECT a FROM t5 WHERE b=10 ORDER BY c;
   261    261   } {