1

How can I see the stats about queries similar to what one can see in the queries tab within the aws console at the cluster panel but using a shell based tool like aws-cli?

2 Answers 2

2

The information about queries executed in Amazon Redshift are stored in System Tables.

See: STL Tables for Logging - Amazon Redshift

It is not possible to access this information via the AWS Command-Line Interface (CLI). You will need to use an SQL client (eg psql) to connect to Redshift to be able to query these tables.

Sign up to request clarification or add additional context in comments.

Comments

1

Although some answers were really close, the queries that appear in the queries tab in the redshift console is at pg_catalog.stv_recents. Having psql installed, one can query that by executing:

psql $connection_string \
    --command="select * from pg_catalog.stv_recents order by starttime desc;"

1 Comment

this table seems to only have about 5 seconds worth of data in it

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.