Currently, if the user wants to know the plan used for a certain statement, [s]he has to prepare the statement on a different attachment.
Depending on the number of statements, this may be an unacceptable overhead.
Plus, there is a change that some index changed after the original statement. The plan could then be different and the analysis compromised.
Please include the statement's PLAN in the monitoring tables. The most straight forward way I can think of is to include a mon$plan field in mon$statements.
In Firebird 3, there are two kind of reported plans: legacy one and new detailed one. Honestly, I'd hate to have them both available in MON$STATEMENTS. Do you think it could be a problem if only the new plan will be reported?
for big queries legacy plan is truncated - and there is no way to get full text of it
Then MON$STATEMENTS will be only place where we can got full text of them.
Why it is important?
As you remember legacy plan can be included in sql itself but explained plan not.
Because of that will be good to have it both
Truncated detailed plans will be fixed (after Beta 2). Not every legacy plan can be specified in the SQL text, so it's pretty much useless for any complex query. So I'm still not sure we need to report legacy plans in MON$STATEMENTS.