Compare commits

...

2 Commits

Author SHA1 Message Date
drh 386bbe95c5 Merge fixes from trunk.
FossilOrigin-Name: 662e8ccf7e6cb0c4520f6c572acf10813ce0b20e
2017-02-17 02:07:15 +00:00
drh 689ed8c89a Increase the estimated cost of sorting when sorting wide results sets, to
account for the extra storage space and I/O required for the external sort.

FossilOrigin-Name: aa0703e5cef0c61bec965d4c88ee48bbc11c3649
2017-02-16 21:29:53 +00:00
3 changed files with 17 additions and 7 deletions
+6 -6
View File
@@ -1,5 +1,5 @@
C Fix\sa\stest\scase\sthat\swas\smade\sto\sfail\sby\sthe\sLIKE\soptimization\senhancement\nin\scheck-in\s[158290c0ab]\sbut\swhich\swent\sunnoticed\sbecause\stest\sbuilds\swere\nrunning\swith\sICU\senabled\sand\sICU\sdisables\sthe\sLIKE\soptimization.
D 2017-02-17T02:04:31.068
C Merge\sfixes\sfrom\strunk.
D 2017-02-17T02:07:15.678
F Makefile.in edb6bcdd37748d2b1c3422ff727c748df7ffe918
F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
F Makefile.msc a89ea37ab5928026001569f056973b9059492fe2
@@ -475,7 +475,7 @@ F src/vxworks.h d2988f4e5a61a4dfe82c6524dd3d6e4f2ce3cdb9
F src/wal.c 40c543f0a2195d1b0dc88ef12142bea690009344
F src/wal.h 06b2a0b599cc0f53ea97f497cf8c6b758c999f71
F src/walker.c 91a6df7435827e41cff6bb7df50ea00934ee78b0
F src/where.c 01baf58b72f3ddb7793cdee2871f751e3e09b35e
F src/where.c 69eb9080ca38ee9cb4d149e9ef3b9fe942299251
F src/whereInt.h c0b092180f04608d80c258174b0a14a1f9c8d02f
F src/wherecode.c 677e95413c472c0b413023b6b69a47f40fce1b04
F src/whereexpr.c 130cdd1a43af71b19755270fb1224874cf55158c
@@ -1556,7 +1556,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
P 8a03be1dc42737ba0712d33f639ea26dc243b20e
R b29803fdd4fd514ba7baa53a58b26311
P aa0703e5cef0c61bec965d4c88ee48bbc11c3649 218b2bbb0de07288889f6762d4461ea8acd78969
R 31061644eb70eec4652c7f54c3de4a2f
U drh
Z af65459984ca8c135fabce3c62812860
Z 016fbe9a5e2938906de76b5256700d32
+1 -1
View File
@@ -1 +1 @@
218b2bbb0de07288889f6762d4461ea8acd78969
662e8ccf7e6cb0c4520f6c572acf10813ce0b20e
+10
View File
@@ -3793,6 +3793,16 @@ static LogEst whereSortingCost(
rScale = sqlite3LogEst((nOrderBy-nSorted)*100/nOrderBy) - 66;
rSortCost = nRow + rScale + 16;
/* For wide sorts (many payload columns) increase the sorting cost
** to account for the additional I/O used by the external sorting
** algorithm when it flushes PMAs to disk.
*/
if( pWInfo->pResultSet
&& pWInfo->pResultSet->nExpr>6
){
rSortCost += sqlite3LogEst(pWInfo->pResultSet->nExpr) - 26;
}
/* Multiple by log(M) where M is the number of output rows.
** Use the LIMIT for M if it is smaller */
if( (pWInfo->wctrlFlags & WHERE_USE_LIMIT)!=0 && pWInfo->iLimit<nRow ){