Skip to content

Add COMPILE trace events for procedures/functions/triggers#7466

Merged
dyemanov merged 2 commits intomasterfrom
trace-psql-compile
Aug 15, 2023
Merged

Add COMPILE trace events for procedures/functions/triggers#7466
dyemanov merged 2 commits intomasterfrom
trace-psql-compile

Conversation

@dyemanov
Copy link
Copy Markdown
Member

@dyemanov dyemanov commented Jan 31, 2023

Allows to track moments of stored modules parsing, corresponding elapsed time and most important -- plans for queries inside those PSQL modules. Plan tracking is also possible if the PSQL module was already loaded before our trace session started, in this case the plan will be reported during the first execution noticed by our trace session.

Example:

2023-01-31T16:53:15.3550 (1334470:0x7f7363b74d50) COMPILE_PROCEDURE
	/work/db/tpc-c/tpcc-fb50.fdb (ATT_28, SYSDBA:NONE, NONE, TCPv4:127.0.0.1/34452)
	/work/firebird/gen/Debug/firebird/bin/isql:1335482

Procedure NEWORD1:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Select Expression (line 23, column 2)
    -> Singularity Check
        -> Filter
            -> Table "DISTRICT" Access By ID
                -> Bitmap
                    -> Index "DISTRICT_PK" Unique Scan
Select Expression (line 28, column 2)
    -> Singularity Check
        -> Nested Loop Join (inner)
            -> Filter
                -> Table "CUSTOMER" Access By ID
                    -> Bitmap
                        -> Index "CUSTOMER_PK" Unique Scan
            -> Filter
                -> Table "WAREHOUSE" Access By ID
                    -> Bitmap
                        -> Index "WAREHOUSE_PK" Unique Scan
      3 ms

@pavel-zotov
Copy link
Copy Markdown

pavel-zotov commented Aug 17, 2023

=== test issue ===
Test "gh_7466_test.py" checks only ability to see 'COMPILE' events in a trace log, w/o details.
Separate test created to check tracking plans of PSQL parts: gh_7466_plans_tracking_test.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants