Loading...

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:
  1. event_timestamp:

  • Type:

    Timestamp.

  • Description:

    When the event happened.

  • Example:

    2023-12-11 19:01:03.543272-05:00

  1. node_name:

  • Type:

    string.

  • Description:

    Which node the event happened on.

  • Example:

    v_db_node0003

  1. event_category:

  • Type:

    string.

  • Description:

    The general kind of event.

  • Examples:

    OPTIMIZATION, EXECUTION.

  1. event_type:

  • Type:

    string.

  • Description:

    The specific kind of event.

  • Examples:

    AUTO_PROJECTION_USED, SMALL_MERGE_REPLACED.

  1. event_description:

  • Type:

    string.

  • Description:

    A sentence explaining the event.

  • Example:

    “The optimizer ran a query using auto-projections”

  1. 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.

  1. path_id:

  • Type:

    integer.

  • Description:

    A number that uniquely identifies the operator in the plan.

  • Examples:

    1, 4…

  1. event_details:

  • Type:

    string.

  • Description:

    Additional specific information related to this event.

  • Example:

    “t1_super is an auto-projection”

  1. 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_timestamp
Timestamptz(35)
Abc
node_name
Varchar(128)
Abc
event_category
Varchar(12)
Abc
event_type
Varchar(64000)
Abc
Varchar(64000)
Abc
operator_name
Varchar(128)
123
path_id
Integer
Abc
Varchar(64000)
Abc
suggested_action
Varchar(64000)
12024-10-31 11:42:24.515966-04:00v_mldb_node0002EXECUTIONEE_COMPILE_MEMORY_ALLOC[null][null]
22024-10-31 11:42:24.543806-04:00v_mldb_node0002EXECUTIONRUNTIME_PREDICATE_EVAL_ORDERScan5
32024-10-31 11:42:24.519233-04:00v_mldb_node0004EXECUTIONEE_COMPILE_MEMORY_ALLOC[null][null]
42024-10-31 11:42:24.546973-04:00v_mldb_node0004EXECUTIONRUNTIME_PREDICATE_EVAL_ORDERScan5
52024-10-31 11:42:24.521130-04:00v_mldb_node0003EXECUTIONEE_COMPILE_MEMORY_ALLOC[null][null]
62024-10-31 11:42:24.546278-04:00v_mldb_node0003EXECUTIONRUNTIME_PREDICATE_EVAL_ORDERScan5
Rows: 1-6 | Columns: 9

Note

For more details, please look at QueryProfiler.