]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
The trunk assumes that an open range constraint on an indexed term (col>?) term match...
authordan <dan@noemail.net>
Mon, 28 Apr 2014 19:34:06 +0000 (19:34 +0000)
committerdan <dan@noemail.net>
Mon, 28 Apr 2014 19:34:06 +0000 (19:34 +0000)
FossilOrigin-Name: 4047ac75e2a8f0b330255501c42e4f04e5ab500d

manifest
manifest.uuid
src/where.c

index 05f3d798c0a94efdfe300afa3b75cf8b7f741fab..b037731f09b56d06fd4b53bd2c162c5a5df9e386 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Update\sunordered.test\sto\stake\sinto\saccount\sfor\sthe\sfact\sthat\sSQLite\snow\sprefers\sa\sfull-table\sscan\sover\sa\snon-covering\sindex\sscan\sthat\svisits\sa\slarge\spercentage\sof\sthe\stable\srows.
-D 2014-04-28T15:11:25.118
+C The\strunk\sassumes\sthat\san\sopen\srange\sconstraint\son\san\sindexed\sterm\s(col>?)\sterm\smatches\s1/4\sof\sthe\sindexed\srows,\sand\sthat\sa\sclosed\sconstraint\s(col\sBETWEEN\s?\sAND\s?)\smatches\s1/64.\sChange\sthis\sbranch\sto\sdo\sthe\ssame.
+D 2014-04-28T19:34:06.281
 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
 F Makefile.in 2ef13430cd359f7b361bb863504e227b25cc7f81
 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -291,7 +291,7 @@ F src/vtab.c 21b932841e51ebd7d075e2d0ad1415dce8d2d5fd
 F src/wal.c 76e7fc6de229bea8b30bb2539110f03a494dc3a8
 F src/wal.h df01efe09c5cb8c8e391ff1715cca294f89668a4
 F src/walker.c 11edb74d587bc87b33ca96a5173e3ec1b8389e45
-F src/where.c 263f8940aa21adabbc397590046f040c54aca5f4
+F src/where.c 0a518940065c10ad8dedf8f2d6e73f1e14eb8472
 F src/whereInt.h 6804c2e5010378568c2bb1350477537755296a46
 F test/8_3_names.test ebbb5cd36741350040fd28b432ceadf495be25b2
 F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2
@@ -1162,7 +1162,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1
 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
 F tool/warnings.sh d1a6de74685f360ab718efda6265994b99bbea01
 F tool/win/sqlite.vsix 030f3eeaf2cb811a3692ab9c14d021a75ce41fff
-P 1b95544f84bf83c28cc15f6d0690fdf8a6bb3941
-R 307957877e44688fb3b83b922c0183e6
+P 20f468dfbcb247e51446fad411a6e6cc0d130411
+R eabc843f8d46cb0d3b0b7dd8faf4ef00
 U dan
-Z 085ae09cb0f2460f340245b5be0529cf
+Z 37bdf577e72e4cd110b1edb4853d30e0
index 8fd0bd92adde1f864f65f90a3e150522266ad2dc..405d43fc27c316c2a54226002639f181cf6c6079 100644 (file)
@@ -1 +1 @@
-20f468dfbcb247e51446fad411a6e6cc0d130411
\ No newline at end of file
+4047ac75e2a8f0b330255501c42e4f04e5ab500d
\ No newline at end of file
index 4c1d81e1833b9f5158a0452ed5dd3021ac0aa63b..4b2eef9c52ab56873788ddf17b2189383608bd18 100644 (file)
@@ -2155,6 +2155,12 @@ static int whereRangeScanEst(
   assert( pLower || pUpper );
   nNew = whereRangeAdjust(pLower, nOut);
   nNew = whereRangeAdjust(pUpper, nNew);
+  /* TUNING: If there is both an upper and lower limit, assume the range is
+  ** reduced by an additional 75%. This means that, by default, an open-ended
+  ** range query (e.g. col > ?) is assumed to match 1/4 of the rows in the
+  ** index. While a closed range (e.g. col BETWEEN ? AND ?) is estimated to
+  ** match 1/64 of the index. */ 
+  if( pLower && pUpper ) nNew -= 20;
   nOut -= (pLower!=0) + (pUpper!=0);
   if( nNew<10 ) nNew = 10;
   if( nNew<nOut ) nOut = nNew;