Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Merged
merged 2 commits into from
Aug 15, 2023

Conversation

dyemanov
Copy link
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

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

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants