How to Check Memory Usage in Snowflake

Galaxy Glossary

How do I check Snowflake warehouse memory usage?

The queryable way to track Snowflake warehouse memory consumption over time.

Sign up for the latest in SQL knowledge from the Galaxy Team!
Welcome to the Galaxy, Guardian!
Oops! Something went wrong while submitting the form.

Description

Table of Contents

What is the fastest way to view warehouse memory usage?

Query the SNOWFLAKE.ACCOUNT_USAGE.WAREHOUSE_LOAD_HISTORY view. It returns 5-minute snapshots of average and peak memory percentages for every warehouse.

How do I write the query?

Filter by WAREHOUSE_NAME and time window.Select AVG_MEMORY_PERCENT and PEAK_MEMORY_PERCENT to see load.

Example code

SELECT start_time,
avg_running,
avg_queued_load,
avg_memory_percent,
peak_memory_percent
FROM SNOWFLAKE.ACCOUNT_USAGE.WAREHOUSE_LOAD_HISTORY
WHERE warehouse_name = 'ECOM_WH'
AND start_time >= DATEADD(day,-7,CURRENT_TIMESTAMP());

Can I see memory by query or user?

Join WAREHOUSE_LOAD_HISTORY with QUERY_HISTORY on WAREHOUSE_ID to attribute memory peaks to specific queries or users.

How often should I check?

Create a task that writes daily aggregates to an internal table, then visualize trends in Galaxy or any BI tool.

Best practices for reducing memory pressure

• Scale warehouse size instead of auto-suspending often.
• Cluster large, frequently scanned tables like Orders.
• Use result caching for repeat analytics.
• Monitor long-running, spool-heavy joins.

.

Why How to Check Memory Usage in Snowflake is important

How to Check Memory Usage in Snowflake Example Usage


-- Spot memory spikes while running month-end revenue query on Orders
SELECT w.start_time,
       w.peak_memory_percent,
       q.query_text
FROM   SNOWFLAKE.ACCOUNT_USAGE.WAREHOUSE_LOAD_HISTORY w
JOIN   SNOWFLAKE.ACCOUNT_USAGE.QUERY_HISTORY q
  ON   w.warehouse_id = q.warehouse_id
WHERE  w.warehouse_name = 'ECOM_WH'
  AND  q.query_text ILIKE '%total_amount%'
  AND  w.start_time >= DATEADD(hour,-3,CURRENT_TIMESTAMP());

How to Check Memory Usage in Snowflake Syntax


SELECT
    start_time,
    warehouse_name,
    avg_memory_percent,   -- Avg memory used during the slice period
    peak_memory_percent,  -- Highest memory % observed
    avg_running,          -- Avg concurrent queries
    avg_blocked           -- Queries waiting for resources
FROM SNOWFLAKE.ACCOUNT_USAGE.WAREHOUSE_LOAD_HISTORY
WHERE warehouse_name = '<WAREHOUSE_NAME>'
  AND start_time BETWEEN <START_TIMESTAMP> AND <END_TIMESTAMP>
ORDER BY start_time;

Common Mistakes

Frequently Asked Questions (FAQs)

Does memory percent equal physical memory?

No. The view shows percentage of Snowflake’s virtual warehouse allocation, not actual GBs.

Can I alert when memory exceeds 80%?

Yes. Create a task that writes peaks to a table, then use Snowflake Alerts (preview) or an external service to notify on threshold breaches.

Is memory data available for paused warehouses?

No. Snapshots exist only when the warehouse is running.

Want to learn about other SQL terms?

Trusted by top engineers on high-velocity teams
Aryeo Logo
Assort Health
Curri
Rubie Logo
Bauhealth Logo
Truvideo Logo
Welcome to the Galaxy, Guardian!
Oops! Something went wrong while submitting the form.