/ Check-in [7473c4df]
Login

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

Overview
Comment:Remove an unnecessary conditional.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | query-plan-experiments
Files: files | file ages | folders
SHA1: 7473c4dfc10a47594affa6f4e071a08dc8838c0c
User & Date: drh 2014-03-31 20:05:20
Context
2014-04-04
18:20
Merge changes to the query planner that strive to ensure that any index usage that is a proper subset of some other index usage always has a slightly higher cost. check-in: 683dd379 user: drh tags: trunk
2014-03-31
20:05
Remove an unnecessary conditional. Closed-Leaf check-in: 7473c4df user: drh tags: query-plan-experiments
19:49
Also make sure an index that is a proper subset of some other index has a higher cost than that other index. Add test cases. check-in: b7830d23 user: drh tags: query-plan-experiments
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/where.c.

  3713   3713   
  3714   3714   /*
  3715   3715   ** Return TRUE if the set of WHERE clause terms used by pA is a proper
  3716   3716   ** subset of the WHERE clause terms used by pB.
  3717   3717   */
  3718   3718   static int whereLoopProperSubset(const WhereLoop *pA, const WhereLoop *pB){
  3719   3719     int i, j;
  3720         -  if( pA->nLTerm>=pB->nLTerm ) return 0;
         3720  +  assert( pA->nLTerm<pB->nLTerm );  /* Checked by calling function */
  3721   3721     for(j=0, i=pA->nLTerm-1; i>=0 && j>=0; i--){
  3722   3722       for(j=pB->nLTerm-1; j>=0; j--){
  3723   3723         if( pB->aLTerm[j]==pA->aLTerm[i] ) break;
  3724   3724       }
  3725   3725     }
  3726   3726     return j>=0;
  3727   3727   }