SQLite

Check-in [249b579f83]
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
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 249b579f83b2922e3e03037186a9402af951e6d1
User & Date: drh 2006-05-11 23:14:59.000
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: 9d7297b9ef 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: 249b579f83 user: drh tags: trunk)
13:33
Fix documentation typo: The name of the competing database engine is "Firebird", not "Firefox". (CVS 3185) (check-in: 8be6a39d71 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/build.c.
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
**     CREATE INDEX
**     DROP INDEX
**     creating ID lists
**     BEGIN TRANSACTION
**     COMMIT
**     ROLLBACK
**
** $Id: build.c,v 1.393 2006/03/24 03:36:26 drh Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>

/*
** This routine is called when a new SQL statement is beginning to
** be parsed.  Initialize the pParse structure as needed.







|







18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
**     CREATE INDEX
**     DROP INDEX
**     creating ID lists
**     BEGIN TRANSACTION
**     COMMIT
**     ROLLBACK
**
** $Id: build.c,v 1.394 2006/05/11 23:14:59 drh Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>

/*
** This routine is called when a new SQL statement is beginning to
** be parsed.  Initialize the pParse structure as needed.
2634
2635
2636
2637
2638
2639
2640
2641



2642

2643
2644
2645
2646
2647
2648
2649
** are based on typical values found in actual indices.
*/
void sqlite3DefaultRowEst(Index *pIdx){
  unsigned *a = pIdx->aiRowEst;
  int i;
  assert( a!=0 );
  a[0] = 1000000;
  for(i=pIdx->nColumn; i>=1; i--){



    a[i] = 10;

  }
  if( pIdx->onError!=OE_None ){
    a[pIdx->nColumn] = 1;
  }
}

/*







|
>
>
>
|
>







2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
** are based on typical values found in actual indices.
*/
void sqlite3DefaultRowEst(Index *pIdx){
  unsigned *a = pIdx->aiRowEst;
  int i;
  assert( a!=0 );
  a[0] = 1000000;
  for(i=pIdx->nColumn; i>=5; i--){
    a[i] = 5;
  }
  while( i>=1 ){
    a[i] = 11 - i;
    i--;
  }
  if( pIdx->onError!=OE_None ){
    a[pIdx->nColumn] = 1;
  }
}

/*