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

https://aws.amazon.com/blogs/big-data/amazon-redshift-engineerings-advanced-table-design-playbook-distribution-styles-and-distribution-keys/

https://aws.amazon.com/blogs/big-data/top-10-performance-tuning-techniques-for-amazon-redshift/

https://docs.aws.amazon.com/redshift/latest/dg/c_best-practices-best-dist-key.html

https://docs.aws.amazon.com/redshift/latest/dg/tutorial-tuning-tables.html

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

https://docs.aws.amazon.com/redshift/latest/dg/c_Loading_tables_auto_compress.html

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

https://docs.aws.amazon.com/redshift/latest/dg/welcome.html

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

Redshift utility scripts
https://github.com/awslabs/amazon-redshift-utils

# Redshift monitoring scripts
https://github.com/awslabs/amazon-redshift-monitoring

# Redshift python User Defined Functions
https://github.com/awslabs/amazon-redshift-udfs

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

git clone https://github.com/awslabs/amazon-redshift-utils

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

.../amazon-redshift-utils/src/AdminScripts/current_session_info.sql
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
,i.query
,trim(i.query) AS sql
FROM stv_sessions s
LEFT JOIN stv_recents i
ON s.process = i.pid
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
./src/AdminScripts/table_inspector.sql
[root@ip-172-31-9-80 amazon-redshift-utils]# cat ./src/AdminScripts/table_inspector.sql
/*
Table Skew Inspector. Please see http://docs.aws.amazon.com/redshift/latest/dg/c_analyzing-table-design.html
for more information.
...

Provide Redshift feedback to Amazon via:
redshift-pm@amazon.com

More from LonzoDB on AWS

Leave a Reply

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