문제

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?

도움이 되었습니까?

해결책

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/

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 dba.stackexchange
scroll top