From: drh <> Date: Fri, 31 May 2024 15:39:00 +0000 (+0000) Subject: Do not even try star-schema detection if the join has fewer than 5 tables, X-Git-Tag: version-3.47.0~363 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5ef9c899770b764a2760f3b35571c3ec8bba5e95;p=thirdparty%2Fsqlite.git Do not even try star-schema detection if the join has fewer than 5 tables, since 5 is the minimum for a positive detection. FossilOrigin-Name: a07ec16bbc056fbc23a7bd58e5e32ef691c13e9babeb542918cf9a01cac40c20 --- diff --git a/manifest b/manifest index c7aef4ab52..8a3110d657 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Document\sthe\sOP_Explain\sopcode.\s\sAdd\sthe\sWhereLoop.rRun\svalue\sas\sP3\sin\nOP_Explain\sopcodes\sassociated\swith\sWhereLoops,\sfor\stesting\spurposes. -D 2024-05-31T14:39:42.881 +C Do\snot\seven\stry\sstar-schema\sdetection\sif\sthe\sjoin\shas\sfewer\sthan\s5\stables,\nsince\s5\sis\sthe\sminimum\sfor\sa\spositive\sdetection. +D 2024-05-31T15:39:00.555 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -840,7 +840,7 @@ F src/vxworks.h d2988f4e5a61a4dfe82c6524dd3d6e4f2ce3cdb9 F src/wal.c 887fc4ca3f020ebb2e376f222069570834ac63bf50111ef0cbf3ae417048ed89 F src/wal.h ba252daaa94f889f4b2c17c027e823d9be47ce39da1d3799886bbd51f0490452 F src/walker.c 7c7ea0115345851c3da4e04e2e239a29983b61fb5b038b94eede6aba462640e2 -F src/where.c 301bedd98cf76463fd57081881607943442bfbba213a58240f7981dec5a160cf +F src/where.c 593d28d3776985733da0f09639100003b444a43db7b6f9a35139f544fdbea358 F src/whereInt.h 002adc3aa2cc10733b9b27958fdbe893987cd989fab25a9853941c1f9b9b0a65 F src/wherecode.c 5ad509221ebb4d3b35a8a6ef361f2c5b54129b8c273aa434dd3053d2e25d1794 F src/whereexpr.c 67d15caf88a1a9528283d68ff578e024cf9fe810b517bb0343e5aaf695ad97dd @@ -2194,8 +2194,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 62199562c26f77d059aa0bbda42a421a7aece828aa94d14a40c701a6384d1cf6 -R 85967a315d01ec0513367341097e62e2 +P 996c46e61d9a53a54018672dd407b8ba8c480dd6795393428f9d5fcb81b47ab5 +R a2ca0792af2e5fd1149a2be149730242 U drh -Z b127a4b9aa205bcbd712a7eda1be0138 +Z dd2c4dbd585f8635955a8cbd6ced885b # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 5d06e47e84..2b915c652e 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -996c46e61d9a53a54018672dd407b8ba8c480dd6795393428f9d5fcb81b47ab5 \ No newline at end of file +a07ec16bbc056fbc23a7bd58e5e32ef691c13e9babeb542918cf9a01cac40c20 \ No newline at end of file diff --git a/src/where.c b/src/where.c index 64bda2327f..2418b41560 100644 --- a/src/where.c +++ b/src/where.c @@ -5274,7 +5274,7 @@ static LogEst whereSortingCost( */ static int computeMxChoice(WhereInfo *pWInfo, LogEst nRowEst){ int nLoop = pWInfo->nLevel; /* Number of terms in the join */ - if( nRowEst==0 && nLoop>=4 ){ + if( nRowEst==0 && nLoop>=5 ){ /* Check to see if we are dealing with a star schema and if so, reduce ** the cost of fact tables relative to dimension tables, as a heuristic ** to help keep the fact tables in outer loops.