DarlingData icon indicating copy to clipboard operation
DarlingData copied to clipboard

sp_PressureDetector for Azure SQL DB

Open samplesty opened this issue 3 years ago • 3 comments

sp_PressureDetector currently fails on Azure SQL DB because of the following reference:

SELECT 
    CEILING
    (
        dosm.total_physical_memory_kb / 1024.
    )
FROM sys.dm_os_sys_memory AS dosm

Would it be possible to aggregate across memory nodes to calculate this, which is available in Azure SQL DB? Something like seems to work for me.

SELECT 
    SUM
    (
        domn.target_kb / 1024.
    )
FROM sys.dm_os_memory_nodes AS domn

I'm happy to submit a PR if this sounds reasonable.

samplesty avatar Oct 28 '22 19:10 samplesty

Sure, go for it.

erikdarlingdata avatar Oct 28 '22 19:10 erikdarlingdata

Thanks for your consideration! I'm getting a lot out of your training and excited to learn more about your tools!

samplesty avatar Oct 28 '22 19:10 samplesty

Crap! Here's the PR link: https://github.com/erikdarlingdata/DarlingData/pull/188

samplesty avatar Oct 28 '22 19:10 samplesty