/ Check-in [249b579f]
Login

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

Overview
Comment:Adjust the default weights on indices so that an index that matches more terms of the where clause wins (by default) over one that matches fewer. Ticket #1808. (CVS 3186)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 249b579f83b2922e3e03037186a9402af951e6d1
User & Date: drh 2006-05-11 23:14:59
Context
2006-05-22
22:04
If an sqlite3_mprintf() call uses a disallowed internal-use-only conversion character, then abort the call with a -1 error code. Ticket #1818. (CVS 3187) check-in: 9d7297b9 user: drh tags: trunk
2006-05-11
23:14
Adjust the default weights on indices so that an index that matches more terms of the where clause wins (by default) over one that matches fewer. Ticket #1808. (CVS 3186) check-in: 249b579f user: drh tags: trunk
13:33
Fix documentation typo: The name of the competing database engine is "Firebird", not "Firefox". (CVS 3185) check-in: 8be6a39d user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/build.c.

    18     18   **     CREATE INDEX
    19     19   **     DROP INDEX
    20     20   **     creating ID lists
    21     21   **     BEGIN TRANSACTION
    22     22   **     COMMIT
    23     23   **     ROLLBACK
    24     24   **
    25         -** $Id: build.c,v 1.393 2006/03/24 03:36:26 drh Exp $
           25  +** $Id: build.c,v 1.394 2006/05/11 23:14:59 drh Exp $
    26     26   */
    27     27   #include "sqliteInt.h"
    28     28   #include <ctype.h>
    29     29   
    30     30   /*
    31     31   ** This routine is called when a new SQL statement is beginning to
    32     32   ** be parsed.  Initialize the pParse structure as needed.
................................................................................
  2634   2634   ** are based on typical values found in actual indices.
  2635   2635   */
  2636   2636   void sqlite3DefaultRowEst(Index *pIdx){
  2637   2637     unsigned *a = pIdx->aiRowEst;
  2638   2638     int i;
  2639   2639     assert( a!=0 );
  2640   2640     a[0] = 1000000;
  2641         -  for(i=pIdx->nColumn; i>=1; i--){
  2642         -    a[i] = 10;
         2641  +  for(i=pIdx->nColumn; i>=5; i--){
         2642  +    a[i] = 5;
         2643  +  }
         2644  +  while( i>=1 ){
         2645  +    a[i] = 11 - i;
         2646  +    i--;
  2643   2647     }
  2644   2648     if( pIdx->onError!=OE_None ){
  2645   2649       a[pIdx->nColumn] = 1;
  2646   2650     }
  2647   2651   }
  2648   2652   
  2649   2653   /*