Question

I use temporary tables for complex processing which is done in several "child" procedures. These procedures are working in the same session, so the temp tables are accessible for them.

Is there a similar option for memory-optimized tables?

Was it helpful?

Solution

In your case, you'd have to use a memory-optimized table variable, and assuming that the child procedures are called by the same SPID, there shouldn't be an issue with visibility. Please see this link:

https://docs.microsoft.com/en-us/sql/relational-databases/in-memory-oltp/faster-temp-table-and-table-variable-by-using-memory-optimization

I will caution you that the cardinality estimator still assumes 1 row for memory-optimized table variables, and this can be an issue for performance.

More info at this link:

https://blogs.msdn.microsoft.com/psssql/2017/05/10/memory-optimized-table-variable-and-cardinality-estimate/

Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange
scroll top