How to find Top 10 Queries

Moderator: NorbertKrupa

Post Reply
sarah
Intermediate
Intermediate
Posts: 77
Joined: Mon Aug 27, 2012 1:34 pm

How to find Top 10 Queries

Post by sarah » Thu Aug 29, 2013 2:42 pm

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!
Have a GREAT day!

id10t
GURU
GURU
Posts: 732
Joined: Mon Apr 16, 2012 2:44 pm

Re: How to find Top 10 Queries

Post by id10t » Thu Aug 29, 2013 3:56 pm

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;

Post Reply

Return to “Vertica Performance Tuning”