07.02.2014 16:58, Zsazsi wrote: > > I am a bit perplexed understanding the meaning of the values of > MON$STATEMENTS.MON$STATE. > > Here is what I found in the FB 2.5 Release notes: > > > Memory Usage in MON$STATEMENTS and MON$STATE > > Memory usage statistics in MON$STATEMENTS and MON$STATE represent actual > CPU consumption. > > Tracker reference: CORE-1583 > <http://tracker.firebirdsql.org/browse/CORE-1583>) > > The tracker referenced here is not clear on how the MON$STATE represents > CPU usage.
MON$STATE = 1 implies that the statement is executing inside the engine at the moment, so *supposedly* it consumes CPU (although it may be waiting for a lock, for example). In turn, MON$STATE = 0 and MON$STATE = 2 means that the statement is not being executed at the moment, so it cannot consume CPU. As simple as that, nothing more. Dmitry