Quantcast
Channel: Entity Framework
Viewing all articles
Browse latest Browse all 10318

Edited Issue: Perf: TruncateTime Performance Problem [696]

$
0
0
On SQL Server, called from Entity Framework, the EntityFunctions.TruncateTime function is translated as follows: CAST( convert (datetime2, convert(varchar(255), [Extent1].[DateTimeBucket], 102) , 102) AS datetime2) AS [K5] Converting to a string, then parsing it back to a DateTime is very slow. A far far better version would be: if >= SQL08: CONVERT(DATE, [Extent1].[DateTimeBucket]) else: http://stackoverflow.com/a/353049/122718 (or other techniques) I acknowledge that converting to a varchar works, but it strikes me as a needless performance waste. This change should not require a lot of effort.

Viewing all articles
Browse latest Browse all 10318

Trending Articles