Skip to content

Commit 65fe03a

Browse files
committed
- 修复 Oracle Any 子查询可能影响索引变慢的问题;
1 parent 8c0e217 commit 65fe03a

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

FreeSql.DbContext/FreeSql.DbContext.xml

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

FreeSql/Internal/CommonExpression.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,6 +1004,18 @@ public string ExpressionLambdaToSql(Expression exp, ExpTSC tsc)
10041004
var fsqlSelect0 = fsql as Select0Provider;
10051005
switch (exp3.Method.Name) {
10061006
case "Any": //exists
1007+
switch (_ado.DataType)
1008+
{
1009+
case DataType.Oracle:
1010+
case DataType.OdbcOracle:
1011+
case DataType.Dameng:
1012+
case DataType.OdbcDameng:
1013+
break;
1014+
default:
1015+
fsqlSelect0._limit = 1; //#462 ORACLE rownum <= 2 会影响索引变慢
1016+
break;
1017+
}
1018+
break;
10071019
case "ToOne":
10081020
case "First":
10091021
fsqlSelect0._limit = 1; //#462

0 commit comments

Comments
 (0)