Loading...

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:
  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
event_description
Varchar(64000)
Abc
operator_name
Varchar(128)
123
path_id
Integer
Abc
event_details
Varchar(64000)
Abc
suggested_action
Varchar(64000)
Rows: 0 | Columns: 9

Note

For more details, please look at QueryProfiler.