Subject mon$statement_id is not consistent between snapshots?
Author Douglas Tosi

Playing with the monitoring tables I just noticed that the same statement
can have different ids on different snapshots. Why is that?

Connection A issues
select count(*) from table

Now suppose that this table is really big and counting takes a long time.
While connection A is counting records, connection B issues
select * from mon$statements where mon$attachment_id <> current_connection

at this point the count statement has id 20.
A bit later, the count finishes and connection B issues the same select on
mon$statements, but now the id is 22.

Is that expected behaviour? That the same statement can show different ids
on different snapshots?
If so, any suggestion how can I uniquely identify a statement?

I´m using FB 2.1 64bit on Vista 64bit.

Douglas Tosi

[Non-text portions of this message have been removed]