Page 1 of 1
How to find Top 10 Queries
Posted: Thu Aug 29, 2013 2:42 pm
by sarah
Hello,
Is there a way in Vertica to find the top 10 queries by number of executions, total cost and total execution time?
I can do this in Oracle easily.
Thank you!
Re: How to find Top 10 Queries
Posted: Thu Aug 29, 2013 3:56 pm
by id10t
Hi!
"COST" - it's not trivial, it require some scripting.
TOP10 by number of executions
Code: Select all
SELECT request,
COUNT(*)
FROM query_requests
GROUP BY request
ORDER BY COUNT(*) DESC
LIMIT 10;
TOP10 by total execution time
Code: Select all
SELECT request,
request_duration_ms
FROM query_requests
ORDER BY request_duration_ms DESC
LIMIT 10;
TOP10 by memory
Code: Select all
SELECT request,
memory_acquired_mb
FROM query_requests
WHERE memory_acquired_mb IS NOT NULL
ORDER BY memory_acquired_mb DESC
LIMIT 10;