How to find active and historical SQL queries in Greenplum database