]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Back port the unordered-index-hack to the 3.7.2 branch.
authordrh <drh@noemail.net>
Sat, 9 Apr 2011 03:30:25 +0000 (03:30 +0000)
committerdrh <drh@noemail.net>
Sat, 9 Apr 2011 03:30:25 +0000 (03:30 +0000)
FossilOrigin-Name: 803530209f9c8d4dcf8ed51b5a96aee1766ef79f

manifest
manifest.uuid
src/analyze.c
src/sqliteInt.h
src/where.c

index 32ee8c3e739bda5ddc2699938ad22d8d2f4dc2fb..99d68efac001534edd5669c0d2c817634d843c29 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Backport\stest\scases\sfrom\strunk\sthat\sseek\sto\sprove\sthat\sthe\sIS\sNOT\sNULL\nquery\soptimization\sis\sworking.
-D 2011-04-08T23:36:09.017
+C Back\sport\sthe\sunordered-index-hack\sto\sthe\s3.7.2\sbranch.
+D 2011-04-09T03:30:25.496
 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
 F Makefile.in 543f91f24cd7fee774ecc0a61c19704c0c3e78fd
 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -107,7 +107,7 @@ F sqlite.pc.in 42b7bf0d02e08b9e77734a47798d1a55a9e0716b
 F sqlite3.1 6be1ad09113570e1fc8dcaff84c9b0b337db5ffc
 F sqlite3.pc.in ae6f59a76e862f5c561eb32a380228a02afc3cad
 F src/alter.c 8dc27638e7e2553e80b2b621f232be5eb1e85ef3
-F src/analyze.c a038162344265ac21dfb24b3fcc06c666ebb9c07
+F src/analyze.c 0a58e3d8228617e619c48a3aa8991a1ff5ad7768
 F src/attach.c 17bec1f18254d9341369f20f90ba24ce35d20d10
 F src/auth.c 523da7fb4979469955d822ff9298352d6b31de34
 F src/backup.c 8ff0b7018df253c7f30d3f9702b0b16f19209d5c
@@ -172,7 +172,7 @@ F src/select.c 7a673c43b49d5f05f76e9c5a8cafa02862cbb901
 F src/shell.c 8517fc1f9c59ae4007e6cc8b9af91ab231ea2056
 F src/sqlite.h.in 2d72a6242df41c517e38eec8791abcf5484a36f1
 F src/sqlite3ext.h 69dfb8116af51b84a029cddb3b35062354270c89
-F src/sqliteInt.h d6afefc8908e921304327144ae8c7422b44bfb0c
+F src/sqliteInt.h 084453ecc60bd7e478d4008fd29a0b68d788126f
 F src/sqliteLimit.h a17dcd3fb775d63b64a43a55c54cb282f9726f44
 F src/status.c 496913d4e8441195f6f2a75b1c95993a45b9b30b
 F src/table.c 2cd62736f845d82200acfa1287e33feb3c15d62e
@@ -230,7 +230,7 @@ F src/vtab.c 0e8e0cb30dffb078367e843e84e37ef99236c7e4
 F src/wal.c 5ac2119e23ee4424599d4275b66dc88d612a0543
 F src/wal.h 96669b645e27cd5a111ba59f0cae7743a207bc3c
 F src/walker.c 3112bb3afe1d85dc52317cb1d752055e9a781f8f
-F src/where.c 6a465e780bbf065f54438b73b6b12dfb73a26d7e
+F src/where.c c232055196c3847206add5852102f2637d50e8ed
 F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2
 F test/alias.test 4529fbc152f190268a15f9384a5651bbbabc9d87
 F test/all.test 6745008c144bd2956d58864d21f7b304689c1cce
@@ -848,7 +848,7 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
 F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
 F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
-P 1d6378898aab5208e1fbaf2683a63650b4987c16
-R b045c370be1787d7b141ea78738ab71f
+P 9eff470226c6f879bb1b24fb00b6786a816d8cfd
+R ec1275508098699736f727d15a36cea8
 U drh
-Z 0143ec47aac262d7a15c469ecf440697
+Z 5ab4f56fbd19b59b57d4609d1b0ffbc9
index 93a856e18ba255d306c5bcafc4a0a2892393bd42..5153a63e499f09e545159211b510105b743989b6 100644 (file)
@@ -1 +1 @@
-9eff470226c6f879bb1b24fb00b6786a816d8cfd
\ No newline at end of file
+803530209f9c8d4dcf8ed51b5a96aee1766ef79f
\ No newline at end of file
index 0a8339bafbad32bc2932abcc73022e6a3fb2e71a..8aef9d7731850b85bb4944a3efd85326d398da1a 100644 (file)
@@ -535,6 +535,10 @@ static int analysisLoader(void *pData, int argc, char **argv, char **NotUsed){
     if( pIndex==0 ) break;
     pIndex->aiRowEst[i] = v;
     if( *z==' ' ) z++;
+    if( memcmp(z, "unordered", 10)==0 ){
+      pIndex->bUnordered = 1;
+      break;
+    }
   }
   return 0;
 }
index 191be0016107069a53928d2106aa3348602dd89d..9aba3be8307c4a6ef1b9eb3f4d9e3b7beb7f4aea 100644 (file)
@@ -1428,6 +1428,7 @@ struct Index {
   int tnum;        /* Page containing root of this index in database file */
   u8 onError;      /* OE_Abort, OE_Ignore, OE_Replace, or OE_None */
   u8 autoIndex;    /* True if is automatically created (ex: by UNIQUE) */
+  u8 bUnordered;   /* Use this index for == or IN queries only */
   char *zColAff;   /* String defining the affinity of each column */
   Index *pNext;    /* The next index associated with the same table */
   Schema *pSchema; /* Schema containing this index */
index ec04b3d4afe6c5c22a2b46adaf8cf2a87906ede7..c1885856c0bc7bd828e6757a6714bea992d9b3c8 100644 (file)
@@ -2864,7 +2864,7 @@ static void bestBtreeIndex(
     }
 
     /* Determine the value of estBound. */
-    if( nEq<pProbe->nColumn ){
+    if( nEq<pProbe->nColumn && pProbe->bUnordered==0 ){
       int j = pProbe->aiColumn[nEq];
       if( findTerm(pWC, iCur, j, notReady, WO_LT|WO_LE|WO_GT|WO_GE, pIdx) ){
         WhereTerm *pTop = findTerm(pWC, iCur, j, notReady, WO_LT|WO_LE, pIdx);
@@ -2896,6 +2896,7 @@ static void bestBtreeIndex(
     ** will scan rows in a different order, set the bSort variable.  */
     if( pOrderBy ){
       if( (wsFlags & WHERE_COLUMN_IN)==0
+        && pProbe->bUnordered==0
         && isSortingIndex(pParse, pWC->pMaskSet, pProbe, iCur, pOrderBy,
                           nEq, wsFlags, &rev)
       ){