From df7c967d54685b18de62b8607b6eb7bfdbc05961 Mon Sep 17 00:00:00 2001 From: NTH19 <3310288189@qq.com> Date: Fri, 19 Aug 2022 22:35:28 +0800 Subject: [PATCH] when eq Filtercount <6 ,the speed of for loop is faster than hashmap add threshold for eqFilter --- dbcon/joblist/dictstep-jl.cpp | 6 ++++-- dbcon/joblist/primitivestep.h | 1 + primitives/primproc/dictstep.cpp | 2 -- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/dbcon/joblist/dictstep-jl.cpp b/dbcon/joblist/dictstep-jl.cpp index 1e39d2407..86f6f4340 100644 --- a/dbcon/joblist/dictstep-jl.cpp +++ b/dbcon/joblist/dictstep-jl.cpp @@ -49,14 +49,16 @@ DictStepJL::DictStepJL(const pDictionaryStep& dict) hasEqFilter = dict.hasEqualityFilter; - if (hasEqFilter) + if (hasEqFilter && dict.eqFilter.size()> USEEQFILTERTHRESHOLD) { eqOp = dict.tmpCOP; eqFilter = dict.eqFilter; } else + { + hasEqFilter=false; filterString = dict.fFilterString; - + } filterCount = dict.fFilterCount; charsetNumber = dict.fColType.charsetNumber; } diff --git a/dbcon/joblist/primitivestep.h b/dbcon/joblist/primitivestep.h index 7b3ebe205..3a19b5b83 100644 --- a/dbcon/joblist/primitivestep.h +++ b/dbcon/joblist/primitivestep.h @@ -544,6 +544,7 @@ class pColScanStep : public JobStep /** @brief class pDictionaryStep * */ +#define USEEQFILTERTHRESHOLD 6 class pDictionaryStep : public JobStep { public: diff --git a/primitives/primproc/dictstep.cpp b/primitives/primproc/dictstep.cpp index 69fa86ccc..b4152e2d6 100644 --- a/primitives/primproc/dictstep.cpp +++ b/primitives/primproc/dictstep.cpp @@ -346,8 +346,6 @@ void DictStep::_execute() newRidList[i].pos = i; } - sort(&newRidList[0], &newRidList[bpp->ridCount], TokenSorter()); - tmpResultCounter = 0; i = 0;