SQLite

Check-in [283bf0b64d]
Login

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

Overview
Comment:Provide one final Select tree dump prior to WHERE clause analysis when ".selecttrace 0x400" tracing bit is set with SELECTTRACE_ENABLED. Analysis and debug changes only - normal builds are unaffected.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 283bf0b64da7acc5aa5812fc659954965002d409
User & Date: drh 2015-06-05 20:27:26.103
Context
2015-06-08
17:40
Split out some source code into new files: wherecode.c, whereexpr.c, and treeview.c. Other minor refactoring changes. (check-in: 50f336818c user: drh tags: trunk)
2015-06-05
22:33
Split FROM-clause subquery flattening and code generation into separate loops. (check-in: be8e3fc70e user: drh tags: view-optimization)
20:27
Provide one final Select tree dump prior to WHERE clause analysis when ".selecttrace 0x400" tracing bit is set with SELECTTRACE_ENABLED. Analysis and debug changes only - normal builds are unaffected. (check-in: 283bf0b64d user: drh tags: trunk)
2015-06-04
12:08
Change the name of SrcList.a[].zIndex to the more descriptive SrcList.a[0].zIndexedBy. (check-in: 6a9cf06337 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/select.c.
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
  /* Finially, delete what is left of the subquery and return
  ** success.
  */
  sqlite3SelectDelete(db, pSub1);

#if SELECTTRACE_ENABLED
  if( sqlite3SelectTrace & 0x100 ){
    sqlite3DebugPrintf("After flattening:\n");
    sqlite3TreeViewSelect(0, p, 0);
  }
#endif

  return 1;
}
#endif /* !defined(SQLITE_OMIT_SUBQUERY) || !defined(SQLITE_OMIT_VIEW) */







|







3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
  /* Finially, delete what is left of the subquery and return
  ** success.
  */
  sqlite3SelectDelete(db, pSub1);

#if SELECTTRACE_ENABLED
  if( sqlite3SelectTrace & 0x100 ){
    SELECTTRACE(0x100,pParse,p,("After flattening:\n"));
    sqlite3TreeViewSelect(0, p, 0);
  }
#endif

  return 1;
}
#endif /* !defined(SQLITE_OMIT_SUBQUERY) || !defined(SQLITE_OMIT_VIEW) */
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
      i = -1;
    }else{
      if( (pItem->jointype & JT_OUTER)==0
       && pushDownWhereTerms(db, pSub, p->pWhere, pItem->iCursor)
      ){
#if SELECTTRACE_ENABLED
        if( sqlite3SelectTrace & 0x100 ){
          sqlite3DebugPrintf("After WHERE-clause push-down:\n");
          sqlite3TreeViewSelect(0, p, 0);
        }
#endif
      }
      if( pTabList->nSrc==1
       && (p->selFlags & SF_All)==0
       && OptimizationEnabled(db, SQLITE_SubqCoroutine)







|







4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
      i = -1;
    }else{
      if( (pItem->jointype & JT_OUTER)==0
       && pushDownWhereTerms(db, pSub, p->pWhere, pItem->iCursor)
      ){
#if SELECTTRACE_ENABLED
        if( sqlite3SelectTrace & 0x100 ){
          SELECTTRACE(0x100,pParse,p,("After WHERE-clause push-down:\n"));
          sqlite3TreeViewSelect(0, p, 0);
        }
#endif
      }
      if( pTabList->nSrc==1
       && (p->selFlags & SF_All)==0
       && OptimizationEnabled(db, SQLITE_SubqCoroutine)
4959
4960
4961
4962
4963
4964
4965







4966
4967
4968
4969
4970
4971
4972
  }
  pEList = p->pEList;
#endif
  pWhere = p->pWhere;
  pGroupBy = p->pGroupBy;
  pHaving = p->pHaving;
  sDistinct.isTnct = (p->selFlags & SF_Distinct)!=0;








#ifndef SQLITE_OMIT_COMPOUND_SELECT
  /* If there is are a sequence of queries, do the earlier ones first.
  */
  if( p->pPrior ){
    rc = multiSelect(pParse, p, pDest);
    explainSetInteger(pParse->iSelectId, iRestoreSelectId);







>
>
>
>
>
>
>







4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
  }
  pEList = p->pEList;
#endif
  pWhere = p->pWhere;
  pGroupBy = p->pGroupBy;
  pHaving = p->pHaving;
  sDistinct.isTnct = (p->selFlags & SF_Distinct)!=0;

#if SELECTTRACE_ENABLED
  if( sqlite3SelectTrace & 0x400 ){
    SELECTTRACE(0x400,pParse,p,("After all FROM-clause analysis:\n"));
    sqlite3TreeViewSelect(0, p, 0);
  }
#endif

#ifndef SQLITE_OMIT_COMPOUND_SELECT
  /* If there is are a sequence of queries, do the earlier ones first.
  */
  if( p->pPrior ){
    rc = multiSelect(pParse, p, pDest);
    explainSetInteger(pParse->iSelectId, iRestoreSelectId);