The from (
Select
Regexp_replace (regexp_replace (a.k freason, '[(] [^ ()] * []'), '[(] [^ ()] * []') kfreason, a.u sername, b.u seralias,
P. ost
The from examdetail a
Left the join projectusers b on b.u sername=a.u sername and b.e iid='4 de7f10f7b534aa8b77d836e42942fa8'
Where
A.e wid (in
Select aa. Ewid from examworkbreed aa where aa. The typeid='10916'
And aa. Eiid='4 de7f10f7b534aa8b77d836e42942fa8 and aa. The ebid & lt;> '0' and aa. Examajor='AFE237EB77F14468B26D7D5CB0097DE9'
)
F)
Where instr (f.k freason, 'answered not attendant equipment wearing a helmet into an area check') & gt; 0;
Kfreason this field after I use regexp_replace remove the parentheses, use a select nesting. But it is slow;
But if not select nested directly, so directly, speed quickly
Select
Regexp_replace (regexp_replace (a.k freason, '[(] [^ ()] * []'), '[(] [^ ()] * []') kfreason, a.u sername, b.u seralias,
P. ost
The from examdetail a
Left the join projectusers b on b.u sername=a.u sername and b.e iid='4 de7f10f7b534aa8b77d836e42942fa8'
Where
A.e wid (in
Select aa. Ewid from examworkbreed aa where aa. The typeid='10916'
And aa. Eiid='4 de7f10f7b534aa8b77d836e42942fa8 and aa. The ebid & lt;> '0' and aa. Examajor='AFE237EB77F14468B26D7D5CB0097DE9'
) and instr (a.k freason, 'did not answer the attendant equipment wearing a helmet into an area check') & gt; 0;
What reason is this?
CodePudding user response:
Look at the execution plan, two queries, respectively is how walkCodePudding user response:
Execution plan is not how you look at it, this is the first SQL statement execution planThis is the second
The same feeling
CodePudding user response:
Feel your this business related, and the key is in parentheses have any effect on the business, or is it possible for all say in parenthesesNo, there's no point in the regular basic.
If must use two regular can merge into one
CodePudding user response:
Where instr (f.k freason, 'answered not attendant equipment wearing a helmet into an area check') & gt; 0;This condition, can filter out a large number of data layers? So, to replace the data will be a lot less, high efficiency naturally
CodePudding user response: