From snowflake-skills
Finds and ranks expensive Snowflake queries by cost, execution time, bytes scanned, or spillage. Analyzes query history for warehouse costs and optimization candidates with recommendations.
npx claudepluginhub altimateai/data-engineering-skills --plugin dbt-skillsThis skill uses the workspace's default tool permissions.
**Query history → Rank by metric → Identify patterns → Recommend optimizations**
Guides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Guides building MCP servers enabling LLMs to interact with external services via tools. Covers best practices, TypeScript/Node (MCP SDK), Python (FastMCP).
Generates original PNG/PDF visual art via design philosophy manifestos for posters, graphics, and static designs on user request.
Query history → Rank by metric → Identify patterns → Recommend optimizations
Before querying, clarify:
Use QUERY_ATTRIBUTION_HISTORY for credit/cost analysis:
SELECT
query_id,
warehouse_name,
user_name,
credits_attributed_compute,
start_time,
end_time,
query_tag
FROM SNOWFLAKE.ACCOUNT_USAGE.QUERY_ATTRIBUTION_HISTORY
WHERE start_time >= DATEADD('days', -7, CURRENT_TIMESTAMP())
ORDER BY credits_attributed_compute DESC
LIMIT 20;
Use QUERY_HISTORY for detailed performance metrics (run separately, not joined):
SELECT
query_id,
query_text,
total_elapsed_time/1000 as seconds,
bytes_scanned/1e9 as gb_scanned,
bytes_spilled_to_local_storage/1e9 as gb_spilled_local,
bytes_spilled_to_remote_storage/1e9 as gb_spilled_remote,
partitions_scanned,
partitions_total
FROM SNOWFLAKE.ACCOUNT_USAGE.QUERY_HISTORY
WHERE query_id IN ('<query_id_1>', '<query_id_2>', ...)
AND start_time >= DATEADD('days', -7, CURRENT_TIMESTAMP());
Look for:
credits_attributed_compute queriesquery_hash repeated (caching opportunity)partitions_scanned = partitions_total (no pruning)gb_spilled (memory pressure)Provide:
-- Time range (required)
WHERE start_time >= DATEADD('days', -7, CURRENT_TIMESTAMP())
-- By warehouse
AND warehouse_name = 'ANALYTICS_WH'
-- By user
AND user_name = 'ETL_USER'
-- Only queries over cost threshold
AND credits_attributed_compute > 0.01
-- Only queries over time threshold
AND total_elapsed_time > 60000 -- over 1 minute