Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

The access path information is truncated to 255 characters in the PLG$PROF_RECORD_SOURCES table. #7752

Closed
sim1984 opened this issue Sep 18, 2023 · 1 comment

Comments

@sim1984
Copy link

sim1984 commented Sep 18, 2023

Environment:
ISQL Version: WI-V5.0.0.1219 Firebird 5.0 Release Candidate 1
Server version:
Firebird/Windows/AMD/Intel/x64 (access method), version "WI-V5.0.0.1219 Firebird 5.0 Release Candidate 1"
Firebird/Windows/AMD/Intel/x64 (remote server), version "WI-V5.0.0.1219 Firebird 5.0 Release Candidate 1/tcp (station9)/P18:C"
Firebird/Windows/AMD/Intel/x64 (remote interface), version "WI-V5.0.0.1219 Firebird 5.0 Release Candidate 1/tcp (station9)/P18:C"
on disk structure version 13.1

For SQL queries where Bitmap Or or Bitmap And is present in the plan, information about the access method in the profiler is cut to 255 characters.

Example:

SELECT COUNT(*)
FROM RDB$RELATIONS R
WHERE 
  (R.RDB$RELATION_NAME = 'RDB$RELATIONS') OR
  (R.RDB$RELATION_NAME = 'RDB$DATABASE') OR
  (R.RDB$RELATION_NAME = 'RDB$COLLATIONS') OR
  (R.RDB$RELATION_NAME = 'RDB$CONFIG') OR
  (R.RDB$RELATION_NAME = 'RDB$EXCEPTIONS') OR
  (R.RDB$RELATION_NAME = 'RDB$FIELDS') OR
  (R.RDB$RELATION_NAME = 'RDB$FUNCTIONS') OR
  (R.RDB$RELATION_NAME = 'RDB$PROCEDURES')

with plan:

Select Expression
    -> Aggregate
        -> Filter
            -> Table "RDB$RELATIONS" as "R" Access By ID
                -> Bitmap Or
                    -> Bitmap Or
                        -> Bitmap Or
                            -> Bitmap Or
                                -> Bitmap Or
                                    -> Bitmap Or
                                        -> Bitmap Or
                                            -> Bitmap
                                                -> Index "RDB$INDEX_0" Unique Scan
                                            -> Bitmap
                                                -> Index "RDB$INDEX_0" Unique Scan
                                        -> Bitmap
                                            -> Index "RDB$INDEX_0" Unique Scan
                                    -> Bitmap
                                        -> Index "RDB$INDEX_0" Unique Scan
                                -> Bitmap
                                    -> Index "RDB$INDEX_0" Unique Scan
                            -> Bitmap
                                -> Index "RDB$INDEX_0" Unique Scan
                        -> Bitmap
                            -> Index "RDB$INDEX_0" Unique Scan
                    -> Bitmap
                        -> Index "RDB$INDEX_0" Unique Scan

In ISQL we see the following:

SQL> set list on;
SQL> SELECT *
CON> FROM PLG$PROF_RECORD_SOURCES
CON> where statement_id = 8564;

PROFILE_ID                      2
STATEMENT_ID                    8564
CURSOR_ID                       1
RECORD_SOURCE_ID                1
PARENT_RECORD_SOURCE_ID         <null>
LEVEL                           0
ACCESS_PATH                     Select Expression

PROFILE_ID                      2
STATEMENT_ID                    8564
CURSOR_ID                       1
RECORD_SOURCE_ID                2
PARENT_RECORD_SOURCE_ID         1
LEVEL                           1
ACCESS_PATH                     -> Aggregate

PROFILE_ID                      2
STATEMENT_ID                    8564
CURSOR_ID                       1
RECORD_SOURCE_ID                3
PARENT_RECORD_SOURCE_ID         2
LEVEL                           2
ACCESS_PATH                     -> Filter

PROFILE_ID                      2
STATEMENT_ID                    8564
CURSOR_ID                       1
RECORD_SOURCE_ID                4
PARENT_RECORD_SOURCE_ID         3
LEVEL                           3
ACCESS_PATH                     -> Table "RDB$RELATIONS" as "R" Access By ID
    -> Bitmap Or
        -> Bitmap Or
            -> Bitmap Or
                -> Bitmap Or
                    -> Bitmap Or
                        -> Bitmap Or
                            -> Bitmap Or
    ...

This issue also came up in the discussion of #7675

There it was decided to replace the ACCESS_PATH type with BLOB SUB_TYPE TEXT. Maybe it’s worth doing the same in the profiler?

@AlexPeshkoff
Copy link
Member

Yes, that will be consistent and help show correct results.

@asfernandes asfernandes self-assigned this Sep 19, 2023
asfernandes added a commit that referenced this issue Sep 19, 2023
characters in the PLG$PROF_RECORD_SOURCES table.
asfernandes added a commit that referenced this issue Sep 19, 2023
characters in the PLG$PROF_RECORD_SOURCES table.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants