Hi! Despite its name, what MON$STATEMENTS show are requests (not statements).
When a stored routine is executed, finished and executed again, its request is re-used. Re-used request maintain its ID and is mapped to MON$STATEMENTS.MON$STATEMENT_ID. Is it an important design of MON$STATEMENTS that this (subsequent execution of a request maintain its ID) happens? I'm having problem with this behavior in the profiler. The profiler main unit of aggregation are requests. But for the profiler, it should not mix (and sometimes not mix - when different request incarnation is get) data. Each request start should be an own thing always. So for this case, request ID would need to be reset when resurrecting a dead request to be executed again. Adriano Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel