Do not generate Convert node in SQL if the converted store type is identical to the operand's #26411
Labels
area-query
punted-for-7.0
Originally planned for the EF Core 7.0 (EF7) release, but moved out due to resource constraints.
type-enhancement
Milestone
There are sometimes scenarios where multiple CLR types can be mapped to the same store type (e.g. PostgreSQL maps Instant, DateTime (with kind UTC), ZonedDateTime (with timezone UTC) and OffsetDateTime (with offset 0) to
timestamp with time zone
; all represent UTC timestamps).These types contain various conversion methods between one another (e.g. Instant.ToDateTimeUtc returns a UTC DateTime). When translating these, a Convert node is needed to have the correct CLR type, but nothing needs to actually happen in SQL since at the database side it's the same type.
When generating SQL for Convert, we could simply avoid the conversion if the node and the operand node's type mappings' store types are the same.
/cc @smitpatel
The text was updated successfully, but these errors were encountered: