verticapy.performance.vertica.qprof.QueryProfiler.get_qsteps#
- QueryProfiler.get_qsteps(unit: Literal['s', 'm', 'h'] = 's', kind: Literal['bar', 'barh'] = 'bar', categoryorder: Literal['trace', 'category ascending', 'category descending', 'total ascending', 'total descending', 'min ascending', 'min descending', 'max ascending', 'max descending', 'sum ascending', 'sum descending', 'mean ascending', 'mean descending', 'median ascending', 'median descending'] = 'sum descending', show: bool = True, **style_kwargs) PlottingBase | TableSample | Axes | mFigure | Highchart | Highstock | Figure | vDataFrame #
Returns the Query Execution Steps chart.
Parameters#
- unit: str, optional
Unit used to draw the chart.
- s:
second
- m:
minute
- h:
hour
- kind: str, optional
Chart Type.
- bar:
Bar Chart.
- barh:
Horizontal Bar Chart.
- categoryorder: str, optional
How to sort the bars. One of the following options:
trace (no transformation)
category ascending
category descending
total ascending
total descending
min ascending
min descending
max ascending
max descending
sum ascending
sum descending
mean ascending
mean descending
median ascending
median descending
- show: bool, optional
If set to True, the Plotting object is returned.
- **style_kwargs
Any optional parameter to pass to the plotting functions.
Returns#
- obj
Plotting Object.
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 get the time breakdown of all the steps in a graphical output, we can call the
get_qsteps
attribute.qprof.get_qsteps(kind="bar")
Loading....Note
For more details, please look at
QueryProfiler
.