]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Add a comment explaining why WhereLoop cost adjustments are omitted for
authordrh <drh@noemail.net>
Fri, 2 May 2014 00:09:40 +0000 (00:09 +0000)
committerdrh <drh@noemail.net>
Fri, 2 May 2014 00:09:40 +0000 (00:09 +0000)
skip-scan loops.

FossilOrigin-Name: 3bc43594aaeee9225c0590677fcce480bedcb37b

manifest
manifest.uuid
src/where.c

index c7b6bc3a2621f8fcd0a3e13340e79ab85d1b83ab..af2b3b36eccdfd7a7462819bae13d77bc5cd7f26 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Fix\san\sobscure\sproblem\sto\sdo\swith\stemp\sregister\sallocation\sthat\scould\soccur\sif\smore\sthan\sone\ssimple\sSELECT\swithin\sa\scompound\sSELECT\suses\sa\spartial\ssort.
-D 2014-05-01T20:26:48.793
+C Add\sa\scomment\sexplaining\swhy\sWhereLoop\scost\sadjustments\sare\somitted\sfor\nskip-scan\sloops.
+D 2014-05-02T00:09:40.134
 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
 F Makefile.in 2ef13430cd359f7b361bb863504e227b25cc7f81
 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -292,7 +292,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 9e67d6c48006445d964bc835ea82500c190c3a6f
+F src/where.c 91dfd382273c3f67fcdc0ac4728f9140f91c6ab3
 F src/whereInt.h 6804c2e5010378568c2bb1350477537755296a46
 F test/8_3_names.test ebbb5cd36741350040fd28b432ceadf495be25b2
 F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2
@@ -1166,7 +1166,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 be2702ce35c713b33c9b7689643b45fb0de6af2a
-R 31df819a20c9dcbfb809510504bd5463
-U dan
-Z aa2318c066a07655ea4b90fb2a4008ea
+P 427409ae106cdab7892a6b50fe30c5f52de5addc
+R ee65c8e54ebb299c9693aee246a7e200
+U drh
+Z 5a37e5aacc1e047352493d523b6fb849
index 76ebe330abcd0f0c7484a23061d08980be1672cf..6c6f1f805debbc59ac87c7f89ebb53c3e7e9902c 100644 (file)
@@ -1 +1 @@
-427409ae106cdab7892a6b50fe30c5f52de5addc
\ No newline at end of file
+3bc43594aaeee9225c0590677fcce480bedcb37b
\ No newline at end of file
index 238d1ef42ad8a525f172ddb4092c40a883f2ddf4..c5892590bca680be93e1c6b6a8f39fdd9fa942a6 100644 (file)
@@ -3783,6 +3783,17 @@ static int whereLoopCheaperProperSubset(
 ** To say "WhereLoop X is a proper subset of Y" means that X uses fewer
 ** WHERE clause terms than Y and that every WHERE clause term used by X is
 ** also used by Y.
+**
+** This adjustment is omitted for SKIPSCAN loops.  In a SKIPSCAN loop, the
+** WhereLoop.nLTerm field is not an accurate measure of the number of WHERE
+** clause terms covered, since some of the first nLTerm entries in aLTerm[]
+** will be NULL (because they are skipped).  That makes it more difficult
+** to compare the loops.  We could add extra code to do the comparison, and
+** perhaps we will someday.  But SKIPSCAN is sufficiently uncommon, and this
+** adjustment is sufficient minor, that it is very difficult to construct
+** a test case where the extra code would improve the query plan.  Better
+** to avoid the added complexity and just omit cost adjustments to SKIPSCAN
+** loops.
 */
 static void whereLoopAdjustCost(const WhereLoop *p, WhereLoop *pTemplate){
   if( (pTemplate->wsFlags & WHERE_INDEXED)==0 ) return;