Description
Summary
The schema generated by "Microsoft.Extensions.Caching.SqlConfig.Tools" for session state storage in SQL was adjusted to use a datetype incompatible with SQL memory-optimized tables. This significantly reduces performance potential using this solution compared to traditional .net framework.
Motivation and goals
the datetimeoffset data type is used in the ASPStateTempSessionsV2 table. This datatype is essentially datetime2 with timezone support.
Options:
-
Create a flag that allows for the use of schema and code that doesn't use datetimeoffset and replaces this with a supported equivalent type (https://docs.microsoft.com/en-us/sql/relational-databases/in-memory-oltp/supported-data-types-for-in-memory-oltp?view=sql-server-ver16).
-
change entirely to supported datatime datatype. I can't be certain if the loss of timezone information will impact existing functionality.
-
Move Timezone or timezoneoffset value to a new column supported within memory optimized tables and handle any adjustments in code using multiple columns.
In scope
- adjust SQL schema to support using memory-optimized tables again.
Out of scope
Forcing changes to the supported datatypes in SQL server for memory optimized tables (even SQL 2022 this isn't supported).
Risks / unknowns
lack of native timezone support?? unsure here.
Examples
Suggestions above. Not sure what else I can provide for examples.
Detailed design
I'm not sure I have enough detail/background as to why the schema was changed to begin with.
-->