简体   繁体   中英

Show redshift queries using aws command line

如何使用类似于aws-cli的基于shell的工具查看有关查询的统计信息,类似于在aws控制台的“ queries选项卡中在群集面板上看到的统计信息?

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.

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;"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM