verticapy.performance.vertica.qprof.QueryProfiler.get_query_events¶
- QueryProfiler.get_query_events() vDataFrame¶
Returns a :py:class`vDataFrame` that contains a table listing query events.
Returns¶
A :py:class`vDataFrame` that contains a table listing query events.
- Columns:
event_timestamp:
- Type:
Timestamp.
- Description:
When the event happened.
- Example:
2023-12-11 19:01:03.543272-05:00
node_name:
- Type:
string.
- Description:
Which node the event happened on.
- Example:
v_db_node0003
event_category:
- Type:
string.
- Description:
The general kind of event.
- Examples:
OPTIMIZATION, EXECUTION.
event_type:
- Type:
string.
- Description:
The specific kind of event.
- Examples:
AUTO_PROJECTION_USED, SMALL_MERGE_REPLACED.
event_description:
- Type:
string.
- Description:
A sentence explaining the event.
- Example:
“The optimizer ran a query using auto-projections”
operator_name:
- Type:
string.
- Description:
The name of the EE operator associated with this event.
Noneif no operator is associated with the event.
- Example:
StorageMerge.
path_id:
- Type:
integer.
- Description:
A number that uniquely identifies the operator in the plan.
- Examples:
1, 4…
event_details:
- Type:
string.
- Description:
Additional specific information related to this event.
- Example:
“t1_super is an auto-projection”
suggested_action:
- Type:
string.
- Description:
A sentence describing potential remedies.
Examples¶
First, let’s import the
QueryProfilerobject.from verticapy.performance.vertica import QueryProfiler
Then we can create a query:
qprof = QueryProfiler( "select transaction_id, statement_id, request, request_duration" " from query_requests where start_timestamp > now() - interval'1 hour'" " order by request_duration desc limit 10;" )
We can look at the query events:
qprof.get_query_events()
📅event_timestampAbcnode_nameAbcevent_categoryAbcevent_typeAbcAbcoperator_name123path_idAbcAbcsuggested_action1 2024-10-31 11:42:24.515966-04:00 v_mldb_node0002 EXECUTION EE_COMPILE_MEMORY_ALLOC [null] [null] 2 2024-10-31 11:42:24.543806-04:00 v_mldb_node0002 EXECUTION RUNTIME_PREDICATE_EVAL_ORDER Scan 5 3 2024-10-31 11:42:24.519233-04:00 v_mldb_node0004 EXECUTION EE_COMPILE_MEMORY_ALLOC [null] [null] 4 2024-10-31 11:42:24.546973-04:00 v_mldb_node0004 EXECUTION RUNTIME_PREDICATE_EVAL_ORDER Scan 5 5 2024-10-31 11:42:24.521130-04:00 v_mldb_node0003 EXECUTION EE_COMPILE_MEMORY_ALLOC [null] [null] 6 2024-10-31 11:42:24.546278-04:00 v_mldb_node0003 EXECUTION RUNTIME_PREDICATE_EVAL_ORDER Scan 5 Rows: 1-6 | Columns: 9Note
For more details, please look at
QueryProfiler.