Skip to content

Instantly share code, notes, and snippets.

@onelharrison
Created February 24, 2019 23:44
Show Gist options
  • Select an option

  • Save onelharrison/908d3b6f16c44d44d371d5bc4ea1e1dc to your computer and use it in GitHub Desktop.

Select an option

Save onelharrison/908d3b6f16c44d44d371d5bc4ea1e1dc to your computer and use it in GitHub Desktop.
Useful queries for working with AWS Redshift
-- find recent queries that hit disk
SELECT query, substring
FROM svl_qlog join svl_query_summary using(query)
WHERE starttime > date(getdate()) - interval '1 day'
AND is_diskbased = 't';
-- see query execution details
SELECT query, step, rows, workmem, label, is_diskbased
FROM svl_query_summary
WHERE query = 321925
ORDER BY workmem DESC;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment