Skip to content

Sql optimization #1738

Discussion options

You must be logged in to vote

@davilko Supporting Linq is absurdly complicated. So yeah, we could make the Linq parsing smart enough to understand when it could use the optimized SQL you wrote up there instead of falling back to the CTE expressions that are necessary for SelectMany() and other random things. That's nothing elegant, just brute force if/then logic to get it done.

In the meantime, you can happily bypass Linq and use the Query<DocumentType>(where clause) syntax to get around it.

"As i understand ItemNumbers it is a just parameter for the sql query, could we just compile query once and use different arrays as a parameter?" -- it might not be that hard to add IEnumerable support as parameters to the compile…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by vplemyannik
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
2 participants