Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d1047faad6 | |||
| 874b5e9fbb | |||
| 73d9eb1bb3 | |||
| 4ea86ac0e3 | |||
| 0609cf85fd | |||
| 290caec8e3 |
@@ -19,7 +19,7 @@ dnl to configure the system for the local environment.
|
||||
# so that we create the export library with the dll.
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
AC_INIT([sqlite],[3.48.0])
|
||||
AC_INIT([sqlite],[3.49.0])
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Call TEA_INIT as the first TEA_ macro to set up initial vars.
|
||||
|
||||
+1
-1
@@ -198,7 +198,7 @@ static u8* fromBase64( char *pIn, int ncIn, u8 *pOut ){
|
||||
deliberate_fall_through; /* FALLTHRU */
|
||||
case 1:
|
||||
pOut[0] = (qv>>16) & 0xff;
|
||||
deliberate_fall_through; /* FALLTHRU */
|
||||
break;
|
||||
}
|
||||
pOut += nbo;
|
||||
}
|
||||
|
||||
@@ -185,7 +185,7 @@ endif
|
||||
# Find wasm-strip, which we need for release builds (see below for
|
||||
# why) but not strictly for non-release builds.
|
||||
ifeq (1,$(MAKING_CLEAN))
|
||||
wasm-strip-bin := irrelevant
|
||||
wasm-strip.bin := irrelevant
|
||||
else
|
||||
wasm-strip.bin ?= $(shell which wasm-strip 2>/dev/null)
|
||||
ifeq (,$(wasm-strip.bin))
|
||||
|
||||
+11
-2
@@ -97,6 +97,15 @@ STRIP_K2.js := $(sqlite3.js) $(sqlite3.mjs) \
|
||||
# Note that we require $(bin.version-info) in order to figure out the
|
||||
# dist file's name, so cannot (without a recursive make) have the
|
||||
# target name equal to the archive name.
|
||||
#
|
||||
# 2025-01-15: Emsdk 4.0.0 introduces, in its generated code, a regex
|
||||
# which contains the pattern /*. That, of course, confuses any C-style
|
||||
# comment-stripper which is not specifically JS-aware and smart enough
|
||||
# to know that it's in a regex or string literal. Because of that,
|
||||
# comment-stripping is currently disabled, which means the builds will
|
||||
# be significantly larger than before.
|
||||
apply_comment_stripper := false
|
||||
# ^^^ shell command true or false
|
||||
dist: \
|
||||
$(bin.stripccomments) $(bin.version-info) \
|
||||
$(dist.build) $(STRIP_K1.js) $(STRIP_K2.js) \
|
||||
@@ -109,8 +118,8 @@ dist: \
|
||||
@cp -p README-dist.txt $(dist-dir.top)/README.txt
|
||||
@cp -p index-dist.html $(dist-dir.top)/index.html
|
||||
@cp -p $(dist.jswasm.extras) $(dist-dir.jswasm)
|
||||
@$(foreach JS,$(STRIP_K1.js),$(call DIST_STRIP_COMMENTS,$(JS),-k))
|
||||
@$(foreach JS,$(STRIP_K2.js),$(call DIST_STRIP_COMMENTS,$(JS),-k -k))
|
||||
@if $(apply_comment_stripper); then $(foreach JS,$(STRIP_K1.js),$(call DIST_STRIP_COMMENTS,$(JS),-k)) fi
|
||||
@if $(apply_comment_stripper); then $(foreach JS,$(STRIP_K2.js),$(call DIST_STRIP_COMMENTS,$(JS),-k -k)) fi
|
||||
@cp -p $(dist.common.extras) $(dist-dir.common)
|
||||
@set -e; \
|
||||
vnum=$$($(bin.version-info) --download-version); \
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
C Version\s3.48.0
|
||||
D 2025-01-14T11:05:00.186
|
||||
C When\schoosing\sbetween\stwo\sindexes\swith\sthe\ssame\scost,\spick\sthe\sone\swith\sthe\nsmaller\spredicted\snumber\sof\sbytes\sper\srow.
|
||||
D 2025-01-15T20:23:22.162
|
||||
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
|
||||
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
|
||||
F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d
|
||||
@@ -7,7 +7,7 @@ F Makefile.in ad349acf91b3569033439fe498fa197aa530cafaa01362eb7daad2f84e43d265
|
||||
F Makefile.linux-generic bd3e3cacd369821a6241d4ea1967395c962dfe3057e38cb0a435cee0e8b789d0
|
||||
F Makefile.msc 39785ec45f9ae0311e49094eff2ee079562246fed6be3b9f632a99d4df20056a
|
||||
F README.md c3c0f19532ce28f6297a71870f3c7b424729f0e6d9ab889616d3587dd2332159
|
||||
F VERSION 8dc0c3df15fd5ff0622f88fc483533fce990b1cbb2f5fb9fdfb4dbd71eef2889
|
||||
F VERSION 01f7606130e48fd58a74d1e45e565f2674819d6eadbc219d328d94bb3362b818
|
||||
F art/icon-243x273.gif 9750b734f82fdb3dc43127753d5e6fbf3b62c9f4e136c2fbf573b2f57ea87af5
|
||||
F art/icon-80x90.gif 65509ce3e5f86a9cd64fe7fca2d23954199f31fe44c1e09e208c80fb83d87031
|
||||
F art/sqlite370.eps aa97a671332b432a54e1d74ff5e8775be34200c2
|
||||
@@ -25,7 +25,7 @@ F autoconf/configure.ac ec7fa914c5e74ff212fe879f9bb6918e1234497e05facfb641f30c4d
|
||||
F autoconf/tea/Makefile.in ba0556fee8da09c066bad85a4457904e46ee2c2eabaa309c0e83a78f2f151a8e
|
||||
F autoconf/tea/README.txt 61e62e519579e4a112791354d6d440f8b51ea6db3b0bab58d59f29df42d2dfe3
|
||||
F autoconf/tea/aclocal.m4 52c47aac44ce0ddb1f918b6993e8beb8eee88f43
|
||||
F autoconf/tea/configure.ac ff2d745f88e493080810b67958d88b4f7a7d79f19e2ee8e7f72ffd6fc04eabc7
|
||||
F autoconf/tea/configure.ac d22326594f005a493a7857cb4ad2496b91480101be731d7f0541bb8d7eba22a2
|
||||
F autoconf/tea/doc/sqlite3.n e1fe45d4f5286ee3d0ccc877aca2a0def488e9bb
|
||||
F autoconf/tea/license.terms 13bd403c9610fd2b76ece0ab50c4c5eda933d523
|
||||
F autoconf/tea/pkgIndex.tcl.in 55aec3c6d7e9a1de9b8d2fdc9c27fd055da3ac3a51b572195e2ae7300bcfd3a2
|
||||
@@ -400,7 +400,7 @@ F ext/misc/README.md d6dd0fe1d8af77040216798a6a2b0c46c73054d2f0ea544fbbcdccf6f23
|
||||
F ext/misc/amatch.c 5001711cbecdd57b288cb613386789f3034e5beb58fbe0c79f2b3d643ffd4e03
|
||||
F ext/misc/anycollseq.c 5ffdfde9829eeac52219136ad6aa7cd9a4edb3b15f4f2532de52f4a22525eddb
|
||||
F ext/misc/appendvfs.c 9642c7a194a2a25dca7ad3e36af24a0a46d7702168c4ad7e59c9f9b0e16a3824
|
||||
F ext/misc/base64.c 95abb0547cb1799d9851f3357c8d7fc3c09a95c63c8772aa3acd5f65f12050f6
|
||||
F ext/misc/base64.c 73c31eb325c71bae2e27276565e3f674fc095d8b0d7a651becb3b241a4d2fa57
|
||||
F ext/misc/base85.c a70c885c5c9350261ea6e7b166038eab21a09cf4fceae856ce41fae9c2213b60
|
||||
F ext/misc/basexx.c 89ad6b76558efbceb627afd5e2ef1d84b2e96d9aaf9b7ecb20e3d00b51be6fcf
|
||||
F ext/misc/blobio.c a867c4c4617f6ec223a307ebfe0eabb45e0992f74dd47722b96f3e631c0edb2a
|
||||
@@ -618,7 +618,7 @@ F ext/session/sqlite3session.c d6f5e3e83b9b0bbc4a8db4837284f0ecc6af5321d4c8e7136
|
||||
F ext/session/sqlite3session.h 683ccbf16e2c2521661fc4c1cf918ce57002039efbcabcd8097fa4bca569104b
|
||||
F ext/session/test_session.c 12e0a2c15fd60f92da4bb29c697c9177ff0c0dbcdc5129a54c47e999f147937a
|
||||
F ext/wasm/EXPORTED_FUNCTIONS.fiddle.in 27450c8b8c70875a260aca55435ec927068b34cef801a96205adb81bdcefc65c
|
||||
F ext/wasm/GNUmakefile 311aa0d5edc7006409962cc77cc26560d92f9be69c2c4302e8bbc68189fd02db
|
||||
F ext/wasm/GNUmakefile 6b42d6de2316ae01a96d1b850932fcab0f2938affc27b48495776903f544a488
|
||||
F ext/wasm/README-dist.txt 6382cb9548076fca472fb3330bbdba3a55c1ea0b180ff9253f084f07ff383576
|
||||
F ext/wasm/README.md a8a2962c3aebdf8d2104a9102e336c5554e78fc6072746e5daf9c61514e7d193
|
||||
F ext/wasm/SQLTester/GNUmakefile e0794f676d55819951bbfae45cc5e8d7818dc460492dc317ce7f0d2eca15caff
|
||||
@@ -668,7 +668,7 @@ F ext/wasm/demo-worker1-promiser.c-pp.html 635cf90685805e21772a5f7a35d1ace80f98a
|
||||
F ext/wasm/demo-worker1-promiser.c-pp.js fcc628cb42fcfaf07d250477801de1e6deb1e319d003976612a0db8d76b9fccc
|
||||
F ext/wasm/demo-worker1.html 2c178c1890a2beb5a5fecb1453e796d067a4b8d3d2a04d65ca2eb1ab2c68ef5d
|
||||
F ext/wasm/demo-worker1.js 836bece8615b17b1b572584f7b15912236a5947fe8c68b98d2737d7e287447ef
|
||||
F ext/wasm/dist.make 653e212c1e84aa3be168d62a10616ccea45ee9585b0192745d2706707a5248ce
|
||||
F ext/wasm/dist.make a5bed3b6e6d6a644e1cd416f18b799b956765333130f948d1065872a7f1ce199
|
||||
F ext/wasm/example_extra_init.c 2347cd69d19d839ef4e5e77b7855103a7fe3ef2af86f2e8c95839afd8b05862f
|
||||
F ext/wasm/fiddle.make d4969f0322a582c57a22ce3541f10a5b09a609d14eab32891f613f43b3c14d8b
|
||||
F ext/wasm/fiddle/fiddle-worker.js 850e66fce39b89d59e161d1abac43a181a4caa89ddeea162765d660277cd84ce
|
||||
@@ -862,8 +862,8 @@ F src/vxworks.h d2988f4e5a61a4dfe82c6524dd3d6e4f2ce3cdb9
|
||||
F src/wal.c 4e6181d8780ab0af2e1388d0754cbe6f2f04593d2b1ab6c41699a89942fd8997
|
||||
F src/wal.h ba252daaa94f889f4b2c17c027e823d9be47ce39da1d3799886bbd51f0490452
|
||||
F src/walker.c d5006d6b005e4ea7302ad390957a8d41ed83faa177e412f89bc5600a7462a014
|
||||
F src/where.c 604f17baed46f4997ffe79f25c07c4b51a4165a5938cc27fe165c7e1ca485d11
|
||||
F src/whereInt.h 1e36ec50392f7cc3d93d1152d4338064cd522b87156a0739388b7e273735f0ca
|
||||
F src/where.c f081a371086f48201948431832f5e9bb1bf6c930397b8d7bcf8aaa9e21d819da
|
||||
F src/whereInt.h 2b0804f300c7f65de4046a1d81c65f01b208d6c08950ccd1fa6b8c16162a8af7
|
||||
F src/wherecode.c 0c3d3199a2b769a5e2bb70feb5003dc85b3d86842ecaf903a47f2b4205ca5dab
|
||||
F src/whereexpr.c 0f93a29cabd3a338d09a1f5c6770620a1ac51ec1157f3229502a7e7767c60b6f
|
||||
F src/window.c 2bf01f9941a64fbcead61a0e3cb5db3fca5094b30d2ff0d23274c2a81d2e2385
|
||||
@@ -2205,11 +2205,11 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350
|
||||
F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7
|
||||
F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139
|
||||
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
|
||||
P 315079b150b47e013e2cde4985bc39d24e0f6f6c6e60f9383fb8ea4ea897c67a
|
||||
R 0ed0cfcc7f2bc831da5d62a3490571ed
|
||||
T +sym-major-relase *
|
||||
T +sym-relase *
|
||||
T +sym-version-3.48.0 *
|
||||
P dbc2d6a244fdafd208239894dbdd8f139db6ca20dd8f1ed00d87028e0cb60570
|
||||
R b4fed608ae80dc9fc4a5de4904cc7901
|
||||
T *branch * consider-idx-width
|
||||
T *sym-consider-idx-width *
|
||||
T -sym-trunk *
|
||||
U drh
|
||||
Z cc77aac977f98c5521d75f4212754ff8
|
||||
Z dfdb92c016b02704a64b8a1056c8f180
|
||||
# Remove this line to create a well-formed Fossil manifest.
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
d2fe6b05f38d9d7cd78c5d252e99ac59f1aea071d669830c1ffe4e8966e84010
|
||||
d4bd0d4214551f88f248698fefc821575b722ce5c194d0b3796f572e4704f641
|
||||
|
||||
+48
-27
@@ -5490,6 +5490,28 @@ static int computeMxChoice(WhereInfo *pWInfo, LogEst nRowEst){
|
||||
return pWInfo->nOutStarDelta>0 ? 18 : 12;
|
||||
}
|
||||
|
||||
/*
|
||||
** Two WhereLoop objects, pCandidate and pBaseline, are known to have the
|
||||
** same cost. Look deep into each to see if pCandidate is even slightly
|
||||
** better than pBaseline. Return false if it is, if pCandidate is is preferred.
|
||||
** Return true if pBaseline is preferred or if we cannot tell the difference.
|
||||
**
|
||||
** Result Meaning
|
||||
** -------- ----------------------------------------------------------
|
||||
** true We cannot tell the difference in pCandidate and pBaseline
|
||||
** false pCandidate seems like a better choice than pBaseline
|
||||
*/
|
||||
static SQLITE_NOINLINE int whereLoopIsNoBetter(
|
||||
const WhereLoop *pCandidate,
|
||||
const WhereLoop *pBaseline
|
||||
){
|
||||
if( (pCandidate->wsFlags & WHERE_INDEXED)==0 ) return 1;
|
||||
if( (pBaseline->wsFlags & WHERE_INDEXED)==0 ) return 1;
|
||||
if( pCandidate->u.btree.pIndex->szIdxRow <
|
||||
pBaseline->u.btree.pIndex->szIdxRow ) return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
** Given the list of WhereLoop objects at pWInfo->pLoops, this routine
|
||||
** attempts to find the lowest cost path that visits each WhereLoop
|
||||
@@ -5511,7 +5533,7 @@ static int wherePathSolver(WhereInfo *pWInfo, LogEst nRowEst){
|
||||
int mxI = 0; /* Index of next entry to replace */
|
||||
int nOrderBy; /* Number of ORDER BY clause terms */
|
||||
LogEst mxCost = 0; /* Maximum cost of a set of paths */
|
||||
LogEst mxUnsorted = 0; /* Maximum unsorted cost of a set of path */
|
||||
LogEst mxUnsort = 0; /* Maximum unsorted cost of a set of path */
|
||||
int nTo, nFrom; /* Number of valid entries in aTo[] and aFrom[] */
|
||||
WherePath *aFrom; /* All nFrom paths at the previous level */
|
||||
WherePath *aTo; /* The nTo best paths at the current level */
|
||||
@@ -5608,7 +5630,7 @@ static int wherePathSolver(WhereInfo *pWInfo, LogEst nRowEst){
|
||||
for(pWLoop=pWInfo->pLoops; pWLoop; pWLoop=pWLoop->pNextLoop){
|
||||
LogEst nOut; /* Rows visited by (pFrom+pWLoop) */
|
||||
LogEst rCost; /* Cost of path (pFrom+pWLoop) */
|
||||
LogEst rUnsorted; /* Unsorted cost of (pFrom+pWLoop) */
|
||||
LogEst rUnsort; /* Unsorted cost of (pFrom+pWLoop) */
|
||||
i8 isOrdered; /* isOrdered for (pFrom+pWLoop) */
|
||||
Bitmask maskNew; /* Mask of src visited by (..) */
|
||||
Bitmask revMask; /* Mask of rev-order loops for (..) */
|
||||
@@ -5626,11 +5648,11 @@ static int wherePathSolver(WhereInfo *pWInfo, LogEst nRowEst){
|
||||
|
||||
/* At this point, pWLoop is a candidate to be the next loop.
|
||||
** Compute its cost */
|
||||
rUnsorted = pWLoop->rRun + pFrom->nRow;
|
||||
rUnsort = pWLoop->rRun + pFrom->nRow;
|
||||
if( pWLoop->rSetup ){
|
||||
rUnsorted = sqlite3LogEstAdd(pWLoop->rSetup, rUnsorted);
|
||||
rUnsort = sqlite3LogEstAdd(pWLoop->rSetup, rUnsort);
|
||||
}
|
||||
rUnsorted = sqlite3LogEstAdd(rUnsorted, pFrom->rUnsorted);
|
||||
rUnsort = sqlite3LogEstAdd(rUnsort, pFrom->rUnsort);
|
||||
nOut = pFrom->nRow + pWLoop->nOut;
|
||||
maskNew = pFrom->maskLoop | pWLoop->maskSelf;
|
||||
isOrdered = pFrom->isOrdered;
|
||||
@@ -5652,15 +5674,15 @@ static int wherePathSolver(WhereInfo *pWInfo, LogEst nRowEst){
|
||||
** extra encouragement to the query planner to select a plan
|
||||
** where the rows emerge in the correct order without any sorting
|
||||
** required. */
|
||||
rCost = sqlite3LogEstAdd(rUnsorted, aSortCost[isOrdered]) + 3;
|
||||
rCost = sqlite3LogEstAdd(rUnsort, aSortCost[isOrdered]) + 3;
|
||||
|
||||
WHERETRACE(0x002,
|
||||
("---- sort cost=%-3d (%d/%d) increases cost %3d to %-3d\n",
|
||||
aSortCost[isOrdered], (nOrderBy-isOrdered), nOrderBy,
|
||||
rUnsorted, rCost));
|
||||
rUnsort, rCost));
|
||||
}else{
|
||||
rCost = rUnsorted;
|
||||
rUnsorted -= 2; /* TUNING: Slight bias in favor of no-sort plans */
|
||||
rCost = rUnsort;
|
||||
rUnsort -= 2; /* TUNING: Slight bias in favor of no-sort plans */
|
||||
}
|
||||
|
||||
/* Check to see if pWLoop should be added to the set of
|
||||
@@ -5686,7 +5708,7 @@ static int wherePathSolver(WhereInfo *pWInfo, LogEst nRowEst){
|
||||
if( jj>=nTo ){
|
||||
/* None of the existing best-so-far paths match the candidate. */
|
||||
if( nTo>=mxChoice
|
||||
&& (rCost>mxCost || (rCost==mxCost && rUnsorted>=mxUnsorted))
|
||||
&& (rCost>mxCost || (rCost==mxCost && rUnsort>=mxUnsort))
|
||||
){
|
||||
/* The current candidate is no better than any of the mxChoice
|
||||
** paths currently in the best-so-far buffer. So discard
|
||||
@@ -5694,7 +5716,7 @@ static int wherePathSolver(WhereInfo *pWInfo, LogEst nRowEst){
|
||||
#ifdef WHERETRACE_ENABLED /* 0x4 */
|
||||
if( sqlite3WhereTrace&0x4 ){
|
||||
sqlite3DebugPrintf("Skip %s cost=%-3d,%3d,%3d order=%c\n",
|
||||
wherePathName(pFrom, iLoop, pWLoop), rCost, nOut, rUnsorted,
|
||||
wherePathName(pFrom, iLoop, pWLoop), rCost, nOut, rUnsort,
|
||||
isOrdered>=0 ? isOrdered+'0' : '?');
|
||||
}
|
||||
#endif
|
||||
@@ -5713,7 +5735,7 @@ static int wherePathSolver(WhereInfo *pWInfo, LogEst nRowEst){
|
||||
#ifdef WHERETRACE_ENABLED /* 0x4 */
|
||||
if( sqlite3WhereTrace&0x4 ){
|
||||
sqlite3DebugPrintf("New %s cost=%-3d,%3d,%3d order=%c\n",
|
||||
wherePathName(pFrom, iLoop, pWLoop), rCost, nOut, rUnsorted,
|
||||
wherePathName(pFrom, iLoop, pWLoop), rCost, nOut, rUnsort,
|
||||
isOrdered>=0 ? isOrdered+'0' : '?');
|
||||
}
|
||||
#endif
|
||||
@@ -5724,24 +5746,23 @@ static int wherePathSolver(WhereInfo *pWInfo, LogEst nRowEst){
|
||||
** pTo or if the candidate should be skipped.
|
||||
**
|
||||
** The conditional is an expanded vector comparison equivalent to:
|
||||
** (pTo->rCost,pTo->nRow,pTo->rUnsorted) <= (rCost,nOut,rUnsorted)
|
||||
** (pTo->rCost,pTo->nRow,pTo->rUnsort) <= (rCost,nOut,rUnsort)
|
||||
*/
|
||||
if( pTo->rCost<rCost
|
||||
|| (pTo->rCost==rCost
|
||||
&& (pTo->nRow<nOut
|
||||
|| (pTo->nRow==nOut && pTo->rUnsorted<=rUnsorted)
|
||||
)
|
||||
)
|
||||
if( (pTo->rCost<rCost)
|
||||
|| (pTo->rCost==rCost && pTo->nRow<nOut)
|
||||
|| (pTo->rCost==rCost && pTo->nRow==nOut && pTo->rUnsort<rUnsort)
|
||||
|| (pTo->rCost==rCost && pTo->nRow==nOut && pTo->rUnsort==rUnsort
|
||||
&& whereLoopIsNoBetter(pWLoop, pTo->aLoop[iLoop]) )
|
||||
){
|
||||
#ifdef WHERETRACE_ENABLED /* 0x4 */
|
||||
if( sqlite3WhereTrace&0x4 ){
|
||||
sqlite3DebugPrintf(
|
||||
"Skip %s cost=%-3d,%3d,%3d order=%c",
|
||||
wherePathName(pFrom, iLoop, pWLoop), rCost, nOut, rUnsorted,
|
||||
wherePathName(pFrom, iLoop, pWLoop), rCost, nOut, rUnsort,
|
||||
isOrdered>=0 ? isOrdered+'0' : '?');
|
||||
sqlite3DebugPrintf(" vs %s cost=%-3d,%3d,%3d order=%c\n",
|
||||
wherePathName(pTo, iLoop+1, 0), pTo->rCost, pTo->nRow,
|
||||
pTo->rUnsorted, pTo->isOrdered>=0 ? pTo->isOrdered+'0' : '?');
|
||||
pTo->rUnsort, pTo->isOrdered>=0 ? pTo->isOrdered+'0' : '?');
|
||||
}
|
||||
#endif
|
||||
/* Discard the candidate path from further consideration */
|
||||
@@ -5755,11 +5776,11 @@ static int wherePathSolver(WhereInfo *pWInfo, LogEst nRowEst){
|
||||
if( sqlite3WhereTrace&0x4 ){
|
||||
sqlite3DebugPrintf(
|
||||
"Update %s cost=%-3d,%3d,%3d order=%c",
|
||||
wherePathName(pFrom, iLoop, pWLoop), rCost, nOut, rUnsorted,
|
||||
wherePathName(pFrom, iLoop, pWLoop), rCost, nOut, rUnsort,
|
||||
isOrdered>=0 ? isOrdered+'0' : '?');
|
||||
sqlite3DebugPrintf(" was %s cost=%-3d,%3d,%3d order=%c\n",
|
||||
wherePathName(pTo, iLoop+1, 0), pTo->rCost, pTo->nRow,
|
||||
pTo->rUnsorted, pTo->isOrdered>=0 ? pTo->isOrdered+'0' : '?');
|
||||
pTo->rUnsort, pTo->isOrdered>=0 ? pTo->isOrdered+'0' : '?');
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -5768,20 +5789,20 @@ static int wherePathSolver(WhereInfo *pWInfo, LogEst nRowEst){
|
||||
pTo->revLoop = revMask;
|
||||
pTo->nRow = nOut;
|
||||
pTo->rCost = rCost;
|
||||
pTo->rUnsorted = rUnsorted;
|
||||
pTo->rUnsort = rUnsort;
|
||||
pTo->isOrdered = isOrdered;
|
||||
memcpy(pTo->aLoop, pFrom->aLoop, sizeof(WhereLoop*)*iLoop);
|
||||
pTo->aLoop[iLoop] = pWLoop;
|
||||
if( nTo>=mxChoice ){
|
||||
mxI = 0;
|
||||
mxCost = aTo[0].rCost;
|
||||
mxUnsorted = aTo[0].nRow;
|
||||
mxUnsort = aTo[0].nRow;
|
||||
for(jj=1, pTo=&aTo[1]; jj<mxChoice; jj++, pTo++){
|
||||
if( pTo->rCost>mxCost
|
||||
|| (pTo->rCost==mxCost && pTo->rUnsorted>mxUnsorted)
|
||||
|| (pTo->rCost==mxCost && pTo->rUnsort>mxUnsort)
|
||||
){
|
||||
mxCost = pTo->rCost;
|
||||
mxUnsorted = pTo->rUnsorted;
|
||||
mxUnsort = pTo->rUnsort;
|
||||
mxI = jj;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -212,7 +212,7 @@ struct WherePath {
|
||||
Bitmask revLoop; /* aLoop[]s that should be reversed for ORDER BY */
|
||||
LogEst nRow; /* Estimated number of rows generated by this path */
|
||||
LogEst rCost; /* Total cost of this path */
|
||||
LogEst rUnsorted; /* Total cost of this path ignoring sorting costs */
|
||||
LogEst rUnsort; /* Total cost of this path ignoring sorting costs */
|
||||
i8 isOrdered; /* No. of ORDER BY terms satisfied. -1 for unknown */
|
||||
WhereLoop **aLoop; /* Array of WhereLoop objects implementing this path */
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user