References to AWS Docs. For Redshift tuning table design distribution styles and distribution keys and much more…

Turning automatic compression on and off – and how auto compress / encoding works

And probably the most important AWS Redshift Doc. of all – the Redshift Developers Guide

And here is the AWSLABS github with a bunch of admin query and utility scripts

Redshift utility scripts

# Redshift monitoring scripts

# Redshift python User Defined Functions

with git installed on an ec2 / linux instance you can clone this as follows:

git clone

One important script to help you identify running queries (and kill if necessary) in this repo:

cd $HOME/amazon-redshift-utils/src/AdminScripts
[root@ip-172-31-9-80 AdminScripts]# cat current_session_info.sql
/* Query showing information about sessions with currently running queries */
SELECT s.process AS pid
,date_Trunc ('second',s.starttime) AS S_START
,datediff(minutes,s.starttime,getdate ()) AS conn_mins
,trim(s.user_name) AS USER
,trim(s.db_name) AS DB
,date_trunc ('second',i.starttime) AS Q_START
,trim(i.query) AS sql
FROM stv_sessions s
LEFT JOIN stv_recents i
ON s.process =
AND i.status = 'Running'
WHERE s.user_name <> 'rdsdb';

Another nice script that identifies distribution skew or lack there of:

find . -name "table_inspect*" -print
[root@ip-172-31-9-80 amazon-redshift-utils]# cat ./src/AdminScripts/table_inspector.sql
Table Skew Inspector. Please see
for more information.

Provide Redshift feedback to Amazon via:

More from LonzoDB on AWS

Leave a Reply

Your email address will not be published. Required fields are marked *