Hello Geeks and welcome to the Day 75 of the long series of One DMV a day. In this series of blogs I will be exploring and explaining the most useful DMVs in SQL Server. As we go ahead in this series we will also talk about the usage, linking between DMVs and some scenarios where these DMVs will be helpful while you are using SQL Server. For the complete list in the series please click here.

So far in memory optimized related DMVs I have covered transactions, checkpoints, hash index, merge and garbage collection related DMVs. Today I will cover another In-Memory related DMV. If someone asks for the size details of a table we are very used to using sp_spaceused. The problem is this does not work with In-Memory tables. And so another DMV for my series, sys.dm_db_xtp_table_memory_stats.

sys.dm_db_xtp_table_memory_stats sp_spaceused

The advantage with sys.dm_db_xtp_table_memory_stats is we can see the details of all In-Memory tables at one go. We have to do a little bit of programming if we need to do this for disk based tables. So the output of this DMV will be as below.

sys.dm_db_xtp_table_memory_stats output

The output is straight forward for sys.dm_db_xtp_table_memory_stats. It gives the memory allocated and memory used by the table and its indexes.

Tomorrow I will be covering another In-Memory optimized tables related DMV. So stay tuned. Till then

Happy Learning,

Like us on FaceBook | Join the fastest growing SQL Server group on FaceBook |
Follow me on Twitter | Follow me on FaceBook