Skip to main content

When native queries are enabled in your Amazon Redshift data warehouse (this can be done by adding supportsNativeQueries=true as a translator property to the data source configuration), you can easily view the 200 most recent queries sent to your data warehouse:

SELECT x.* FROM table( call "dwh.native"(
"request" => 'select query, pid, elapsed, substring from svl_qlog
ORDER BY starttime DESC
limit 200'
) ) w,
ARRAYTABLE( w.tuple COLUMNS query string, pid integer , elapsed string,
"substring" string ) x;

 

For more detail, you can see Redshift documentation: View Recent Queries and SVL_QLOG.

Be the first to reply!

Reply