verticapy.performance.vertica.qprof.QueryProfiler.insert¶
- QueryProfiler.insert(transactions: int | tuple | list[int] | list[tuple[int, int]]) None¶
Functions to insert new transactions to the copy of the performance tables.
transactions: str | tuple | list, optional Six options are possible for this parameter:
- An
integer: It will represent the
transaction_id, thestatement_idwill be set to 1.
- An
- A
tuple: (transaction_id, statement_id).
- A
- A
listoftuples: (transaction_id, statement_id).
- A
- A
listofintegers: the
transaction_id; thestatement_idwill automatically be set to 1.
- A
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 easily insert new transactions:
qprof.insert([(1, 4), (3, 9)])
010is_current123transaction_id123statement_idAbcrequest_labelAbc123qduration📅start_timestamp📅end_timestamp0 ✅ 45035996275851310 2 8.409364 2024-08-08 16:45:36.608497 2024-08-08 16:45:45.012267 Rows: 1-1 | Columns: 9Note
For more details, please look at
QueryProfiler.