DEV Community

tongxi
tongxi

Posted on

openGauss MOT JIT Diagnostics

mot_jit_detail
This built-in function is used to query the details about JIT compilation (code generation).

Usage Examples
""
select * from mot_jit_detail();

select proc_oid, substr(query, 0, 50), namespace, jittable_status, valid_status, last_updated, plan_type, codegen_time from mot_jit_detail();
Output Description
Field

Description

proc_oid

Procedure OID (Real Object ID of the procedure in the database). 0 for queries.

query

Query string or stored procedure name.

namespace

Namespace to which the query or procedure belongs to. For procedures and top level queries, the value will be GLOBAL. For all the invoke queries, sub-queries, this field will show the parent information.

jittable_status

Whether the query or procedure is jittable:
jittable – Query or procedure is jittable
unjittable - Query or procedure is not jittable
invalid - Invalid state (temporary state after invalidation due to DDL or when JIT compilation is in progress)
valid_status

Whether the query or procedure is valid or not:

valid – Query or procedure is valid
unavailable – JIT compilation is in progress
error – Error state
dropped – Procedure is dropped
replaced – Procedure is replaced
last_updated

Timestamp when the status was updated last time.

plan_type

Whether this is a stored procedure (SP) or query type.

codegen_time

Total time taken for code generation (JIT compilation), in micro seconds.

verify_time

LLVM Verification time (internal), in micro seconds.

finalize_time

LLVM Finalize time (internal), in micro seconds.

compile_time

LLVM Compile time (internal), in micro seconds.

mot_jit_profile
This built-in function is used to query the profiling data (performance data) of the query or stored procedure execution.

Usage Examples
""
select * from mot_jit_profile();

select proc_oid, id, parent_id, substr(query, 0, 50), namespace, weight, total, self, child_gross, child_net from mot_jit_profile();
Output Description
Field

Description

proc_oid

Procedure OID (Real Object ID of the procedure in the database). 0 for queries.

id

Internal ID to manipulate the output.

parent_id

Parent ID (Internal ID of the parent). Applicable only for sub-queries and sub-procedures. -1 for top-level queries and procedures.

query

Query string or stored procedure name.

namespace

Namespace to which the query or procedure belongs to. For procedures and top level queries, the value will be GLOBAL. For all the invoke queries, sub-queries, this field will show the parent information.

weight

The average number of times the sub-query or sub-procedure was executed (per one parent SP execution), in micro seconds.

total

Total time taken to execute the query or procedure, in micro seconds.

self

Time taken by the query or procedure excluding the time taken by the sub-queries & sub-procedures, in micro seconds.

child_gross

Total time spent in execution of all the sub-queries & sub-procedures (child_net + time spent to prepare for execution of all the sub-queries & sub-procedures), in micro seconds.

child_net

Total time taken by all the sub-queries & sub-procedures i.e., ∑ (total of child * weight), in micro seconds.

def_vars

Time taken to define variables (internal), in micro seconds.

init_vars

Time taken to initialize variables (internal), in micro seconds.

Miscellaneous
Another useful system table to get information about stored procedures and functions is pg_proc.

For example, body of a stored procedure can be queried using the following query:

""
select proname,prosrc from pg_proc where proname='sp_call_filter_rules_100_1';

Top comments (0)