Feature #7675 - EXPLAIN statement and RDB$SQL package.#7697
Conversation
|
Plan output in explain format is broken. Although RDB$SQL.EXPLAIN itself determines the level correctly, the indentation in the explain format is not correct. Firebird 4.0 Firebird 5.0 with explain feature The likely reason for this is the contents of the ACCESS_PATH column The indentation for the first line is correct, but the indentation for subsequent lines is not added to the indentation. |
|
In addition, it would be nice to reserve columns for the future |
|
Cardinality may already be returned. |
|
Here is another question, why? I understand that here the plan is parsed in terms of sources of records. However, when parsing the plan itself, it would be convenient to see the indexes used as entity names, rather than parsing inside the ACCESS_PATH. |
|
It would also be nice to add an OBJECT_TYPE column: (table, procedure ...) |
Every record returned matches a RecordSource, that is the bases also of the profiler. If we broke this rule, it will not be good to have different representations in these two places. See topic "Detailed plan" that I started in fb-devel about the indentations without levels. |
|
Should we also add a columns for the internal RecordSource class name? |
|
The line indentation for BitmapTableScan is fairly easy to fix. It is enough to add the current indent not to the entire ACCESS_PATH line, but to the line itself and after each line break. |
I added it, using same code as I do not like it too much (in most cases a string string is better for such things IMO), but did to be consistent. Profiler uses a string for |
|
In some cases, the output parameter ACCESS_PATH VARCHAR(255) may not be long enough. This will happen when bitmasks are combined. Example: SELECT *
FROM RDB$SQL.EXPLAIN(Q'{
SELECT *
FROM RDB$RELATIONS
WHERE RDB$RELATIONS.RDB$RELATION_NAME IN ('RDB$PAGES', 'RDB$DATABASE', 'RDB$FIELDS')
}'); |
|
In addition, the padding for Bitmap And is displayed incorrectly and the Legacy plan breaks (extra comma). select *
from RDB$INDICES
where RDB$FOREIGN_KEY = 'RDB$RELATION_ID'
and RDB$RELATION_NAME = 'RDB$RELATIONS'Legacy plan: Explain plan: |
Any opinions if we enlarge it or just use text blob? |
Let's wait merge of #7709 to fix, it will create conflicts with this. |
|
On 8/15/23 12:30, Adriano dos Santos Fernandes wrote:
In some cases, the output parameter ACCESS_PATH VARCHAR(255) may
not be long enough. This will happen when bitmasks are combined.
Any opinions if we enlarge it or just use text blob?
I see no problems with use of text blob here.
|
6004982 to
a2d8e64
Compare
No description provided.