From: drh <> Date: Thu, 6 Jun 2024 01:00:50 +0000 (+0000) Subject: Small performance optimization in the operatorMask routine of the WHERE X-Git-Tag: version-3.47.0~350 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=48f5e527283d1f8a3811bd157a15d1ae34ad03d7;p=thirdparty%2Fsqlite.git Small performance optimization in the operatorMask routine of the WHERE clause analysis logic. FossilOrigin-Name: 9d69fc1c87ae673356869ecd89eb19734fd126702c0f9fe595336ecd7be89e08 --- diff --git a/manifest b/manifest index 1062c51e50..4e7f7a5c77 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Small\sperformance\soptimization\sin\sthe\sallowedOp()\sroutine\sof\sthe\sWHERE\nclause\sanalysis\scode. -D 2024-06-06T00:49:36.480 +C Small\sperformance\soptimization\sin\sthe\soperatorMask\sroutine\sof\sthe\sWHERE\nclause\sanalysis\slogic. +D 2024-06-06T01:00:50.319 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -843,7 +843,7 @@ F src/walker.c 7c7ea0115345851c3da4e04e2e239a29983b61fb5b038b94eede6aba462640e2 F src/where.c 343e74d65856665f2aac59a9fcefecfc988e9af4aafa0bd1b8332a89c6c725b4 F src/whereInt.h 002adc3aa2cc10733b9b27958fdbe893987cd989fab25a9853941c1f9b9b0a65 F src/wherecode.c c9cac0b0b8e809c5e7e79d7796918907fb685ad99be2aaa9737f9787aa47349c -F src/whereexpr.c 6410cd2cd4f2d97c5c14bdd38650f0da712e75077d2014beff9a0bca93e2b893 +F src/whereexpr.c 52a59e9252d5823ce2214093ad137af6e3b793d11d76491c41d9a3bac5eb591a F src/window.c 5d95122dd330bfaebd732358c8ef067c5a9394a53ac249470d611d0ce2c52be2 F test/8_3_names.test ebbb5cd36741350040fd28b432ceadf495be25b2 F test/affinity2.test ce1aafc86e110685b324e9a763eab4f2a73f737842ec3b687bd965867de90627 @@ -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 816d4749384c7f398912c905a16c83b88f4c55632050b4c6117c61301d1a53e1 -R 19dca2cd3f6ce49e135153d860cdf2bd +P 4ba8be544711e07748e8dd3ca6b81f9897906061c0a1a1bb4fb3808dc27f734b +R b3146f257e797db20c45e271ef1b262b U drh -Z 62188313bf6cfe2c21e1198d3cb7d57d +Z a340deed3f1e0f0688e4671428f60e91 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 506b63edcf..d88412a96b 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -4ba8be544711e07748e8dd3ca6b81f9897906061c0a1a1bb4fb3808dc27f734b \ No newline at end of file +9d69fc1c87ae673356869ecd89eb19734fd126702c0f9fe595336ecd7be89e08 \ No newline at end of file diff --git a/src/whereexpr.c b/src/whereexpr.c index 7bb2fc643f..41d6ac9f04 100644 --- a/src/whereexpr.c +++ b/src/whereexpr.c @@ -139,15 +139,16 @@ static u16 exprCommute(Parse *pParse, Expr *pExpr){ static u16 operatorMask(int op){ u16 c; assert( allowedOp(op) ); - if( op==TK_IN ){ + if( op>=TK_EQ ){ + assert( (WO_EQ<<(op-TK_EQ)) < 0x7fff ); + c = (u16)(WO_EQ<<(op-TK_EQ)); + }else if( op==TK_IN ){ c = WO_IN; }else if( op==TK_ISNULL ){ c = WO_ISNULL; - }else if( op==TK_IS ){ - c = WO_IS; }else{ - assert( (WO_EQ<<(op-TK_EQ)) < 0x7fff ); - c = (u16)(WO_EQ<<(op-TK_EQ)); + assert( op==TK_IS ); + c = WO_IS; } assert( op!=TK_ISNULL || c==WO_ISNULL ); assert( op!=TK_IN || c==WO_IN );