verticapy.performance.vertica.qprof_interface.QueryProfilerInterface.get_query_events#
- QueryProfilerInterface.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.
None
if 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
QueryProfiler
object.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_timestampTimestamptz(35)Abcnode_nameVarchar(128)Abcevent_categoryVarchar(12)Abcevent_typeVarchar(64000)Abcevent_descriptionVarchar(64000)Abcoperator_nameVarchar(128)123path_idIntegerAbcevent_detailsVarchar(64000)Abcsuggested_actionVarchar(64000)Rows: 0 | Columns: 9Note
For more details, please look at
QueryProfiler
.