Open firebird-automations opened 11 years ago
Commented by: @dyemanov
Cost is an estimation used by the optimizer. It exists for retrievals, but it doesn't exist for modifications and some CPU bound operations like loops or condition evaluations. What should be returned as a cost for UPDATE then - cost of its underlying select or something wider?
If you're talking about actual (not estimated) costs, they're more or less reflected in MON$RECORD_STATS for the every attachment, so it's quite easy to get top 10 of the heaviest requests currently running.
Commented by: @sim1984
I mean it was estimated value, which seems to be planned output in the extended query plan.
Submitted by: @sim1984
Votes: 1
In some cases it would be useful to have an estimate of the cost in a separate column of the table mon$statements. This extends the ticket CORE2303. This would allow, for example, learn the 10 most costly in terms of cost requests.
select * from mon$statements order by mon$statements.mon$cost desc rows 10