Linq2db keeps adding N to varchar in queries even if column of view is varchar slowing down a lot the execution
See original GitHub issueI’m having very slow queries cause linq2db keeps adding N in front of varchars in the generated query even if the column on witch the comparison is done is varchar and not nvarchar. Why is that? Removing the N the query is much faster.
The code used in the where clause below. I use a list of strings and contains to ensure that a column is present in those values.
where mtListOfStrings.Contains(myColumnName)
How can I avoid this behaviour?
Issue Analytics
- State:
- Created a year ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
LINQ Search nvarchar(MAX) column extremely slow using . ...
I have indexes in the database but cannot add one for CompanyName as it is Nvarchar(MAX). I have also looked at the execution...
Read more >Query Performance Issues on VARCHAR Data Type Using ...
In this article, we'll discuss data type VARCHAR and query performance issues associated with utilizing the lower level VARCHAR data type.
Read more >Avoiding Entity Framework Slowdown
Because Entity Framework assumes my column is a Unicode column, it slaps the N in front of my string constant ('Vogel') to turn...
Read more >Indexed varchar column very slow (40M+ rows)
Reading lots of rows just takes some time. If you limit the columns you select and add those columns to the index (and...
Read more >8 Tips and Tricks for Writing the Best Queries in LINQ to ...
This blog post provides a few tips and best practices to consider when writing LINQ to Entities to ensure they run quickly and...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yes. in C# we have string type only but database usually have several text types and we don’t know which one is used
@MaceWindu thanks again! very clear and fast to respond 👍