You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
EmptyCollectionRewriter visits every node twice: query compilation is exponential in SQL tree depth #249
bugSomething isn't workingpackage/efcoreAffects CodoMetis.ValueRanges.EFCore.PostgreSQLseverity/highWrong results, crash or failed writes in a realistic scenario
EmptyCollectionRewriter (#137) visits every non-SELECT node twice, so the plugin's SQL processing takes time exponential in the SQL tree's depth, on every query, ExecuteUpdate and ExecuteDelete (it runs through ValueRangesParameterBasedSqlProcessorFactory). The query does not need to touch a range or set column. Found by the final pre-release analysis on add665c.
It doubles with each term, so a dynamic filter of 30 or more terms effectively never compiles. #137 is new in 10.0.0, so nothing that shipped is affected.
Change
var visited = base.VisitExtension(node); if (visited is not SelectExpression select) return visited;. With that change, all four sizes take 1–2 ms, and the EF unit (285) and integration (265) suites stay green. Check the plugin's other ExpressionVisitors in Query/ for the same double visit.
Done when
A test translates a query with 40 OR'd non-foldable predicates within a generous bound (or counts the rewriter's visits so the result doesn't depend on timing), and fails with the double visit restored.
bugSomething isn't workingpackage/efcoreAffects CodoMetis.ValueRanges.EFCore.PostgreSQLseverity/highWrong results, crash or failed writes in a realistic scenario
Activity