From: drh Date: Wed, 27 Jul 2016 19:30:53 +0000 (+0000) Subject: Enhance the query planner cost estimation for index scans to take into account X-Git-Tag: version-3.14.0~34 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5f26e00761b3f886bc030f5f492115c86e2ba856;p=thirdparty%2Fsqlite.git Enhance the query planner cost estimation for index scans to take into account WHERE clause terms that can be computed using only the index and that do not require looking up rows in the original table. This fixes an obscure performance regression that arose when the ORDER BY LIMIT optimization was added by check-in [bf46179d44843]. FossilOrigin-Name: 9e2b26811452a5011d0a97a689636fa4409da856 --- 5f26e00761b3f886bc030f5f492115c86e2ba856 diff --cc manifest index 185e06b3cc,b810c2000b..d0e7b14e54 --- a/manifest +++ b/manifest @@@ -1,5 -1,5 +1,5 @@@ - C Initialize\sa\svariable\sin\swhere.c\sto\savoid\sa\svalgrind\swarning. - D 2016-07-27T16:03:54.108 -C Add\stest\scases\sand\sfix\sa\scomment. -D 2016-07-27T19:20:58.611 ++C Enhance\sthe\squery\splanner\scost\sestimation\sfor\sindex\sscans\sto\stake\sinto\saccount\nWHERE\sclause\sterms\sthat\scan\sbe\scomputed\susing\sonly\sthe\sindex\sand\sthat\sdo\snot\nrequire\slooking\sup\srows\sin\sthe\soriginal\stable.\s\sThis\sfixes\san\sobscure\nperformance\sregression\sthat\sarose\swhen\sthe\sORDER\sBY\sLIMIT\soptimization\swas\nadded\sby\scheck-in\s[bf46179d44843]. ++D 2016-07-27T19:30:53.586 F Makefile.in 6c20d44f72d4564f11652b26291a214c8367e5db F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.msc d66d0395c38571aab3804f8db0fa20707ae4609a @@@ -463,7 -463,7 +463,7 @@@ F src/vxworks.h d2988f4e5a61a4dfe82c652 F src/wal.c 02eeecc265f6ffd0597378f5d8ae9070b62a406a F src/wal.h 6dd221ed384afdc204bc61e25c23ef7fd5a511f2 F src/walker.c 0f142b5bd3ed2041fc52d773880748b212e63354 - F src/where.c 9981707ac01438baea5caa0ca6108237be6630da -F src/where.c 66a290310e71491ffc9c74108413176438aa8718 ++F src/where.c 8ccc01f9227d41bfaf09360f108583be4a36d3b1 F src/whereInt.h e5b939701a7ceffc5a3a8188a37f9746416ebcd0 F src/wherecode.c 99707d11907c71d289ee9553d2d1a22f1fd8ba41 F src/whereexpr.c d7dcbf14ce1b5876c1f76496162c30fcba669563 @@@ -1507,7 -1508,7 +1508,8 @@@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a9 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 - P 483994a54dee3c7a3801e0e9d3c96fa9dbd8d2fd - R d3646a4fd33e16c76415db60501a55b1 - U dan - Z 64999ea9da24ca9027e2e455a4d899cc -P a59b5622f7cc6e502d71aabc12c053582cd03609 -R f515f9eadedb75a99af064851213e82e ++P 4d59df02d3713b3e3804e1a88e676749b2794286 50f8ea37fb9647c4a9da2c269a4d6f54b10ce96b ++R a589b595bdfe9868de18def836f199ce ++T +closed 50f8ea37fb9647c4a9da2c269a4d6f54b10ce96b + U drh -Z 99f5c72d7c6c2cd0c635c52258200786 ++Z 994e8dc5cbb7e25d0e8cc4a952504fbd diff --cc manifest.uuid index 83f63152b3,213abdc7d3..9b63447ecc --- a/manifest.uuid +++ b/manifest.uuid @@@ -1,1 -1,1 +1,1 @@@ - 4d59df02d3713b3e3804e1a88e676749b2794286 -50f8ea37fb9647c4a9da2c269a4d6f54b10ce96b ++9e2b26811452a5011d0a97a689636fa4409da856