v_monitor.query_requests performs very slowly
Hi,
select * from v_monitor.query_requests order by start_timestamp desc limit 100
takes ~ 20 seconds.
query_requests only 20 K rows.
Any ideas how to workaround?
Ramunas
select * from v_monitor.query_requests order by start_timestamp desc limit 100
takes ~ 20 seconds.
query_requests only 20 K rows.
Any ideas how to workaround?
Ramunas
0
Comments
The query that you are executing is hitting the system table.
Such queries use sysquery resource pool which has reserved memory of 64MB.
This might be the reason why they are slow.
However, I cannot recommend to increase the memory size of this pool.
Also, just check if you need to do a order by desc clause.....I think the records are already sorted in this table.
Hope this helps.
You can increase you sysquery resources(not recommended), or you can limit the number of columns retrieved from the query_requests table.
You can use label hint to track your query inside the v_monitor system table, with this you can create then a script that will pullout the data(mem use , exec time, used pool, mas resources , etc..)
See example: - the query will use the transaction_id and it's statement_id to identify the exact amount of resources used during the execution.
- see the label name.
- i exit the session just to make sure i capture the exact transaction_id and statement_id.
I hope i am right - hope the Vertica experts could correct if anything is wrong.
Regards,
Eric Owhadi
Vertica system views are not fully optimize , the way i use to improve their performance , is by creation query that is subset of this this views . Below is an example for your case : select ri.node_name, ri.user_name,
ri.session_id,
ri.request_id,
ri.transaction_id,
ri.statement_id,
ri.request_type,
replace(replace(ri.request, E'\\n', ' '), E'\\t', ' ') as request,
ri.label as request_label,
ri.search_path,
ri.time as start_timestamp
from
v_internal.dc_requests_issued ri
order by start_timestamp desc limit 100 ;
Time: First fetch (100 rows): 4266.142 ms. All rows formatted: 4269.602 ms
select * from v_monitor.query_requests order by start_timestamp desc limit 100
Time: First fetch (100 rows): 33306.925 ms. All rows formatted: 33313.229 ms