SELECT * FROM nz_query_history WHERE job_id = 'your_job_id';
Replace 'your_job_id' with the actual job ID for the query you want to inspect. If you are interested in all queries executed within a specific timeframe, replace 'your_job_id' with the appropriate conditions (e.g., WHERE start_time >= 'start_date' AND start_time <= 'end_date';).
job_id | start_time | end_time | user_name | application_name | num_rows_affected | num_bytes_read | num_bytes_written | num_bytes_spilled | num_bytes_cached | status |
---|---|---|---|---|---|---|---|---|---|---|
1234567890 | 2022-03-01 09:00:01.000 | 2022-03-01 09:00:03.000 | john_doe | psql | 0 | 1024 | 0 | 0 | 0 | success |
876543210 | 2022-03-01 09:05:01.000 | 2022-03-01 09:05:05.000 | jane_doe | psql | 1000 | 8192 | 6400 | 0 | 1024 | success |
By leveraging the nz_query_history table, you can effectively monitor query performance, identify potential issues, and optimize your Netezza database workloads more efficiently. Analyzing the data returned from this system catalog view allows you to make informed decisions to improve overall system performance and optimize your queries for better results.