Hi Magnus,
When user browses sessions and wants to see the text of SQL executed
by active sessions, Lab128 takes SQL_ID (SQL address/hash for older
versions) and check if it already cached this SQL text. If it is a new
SQL ID, Lab128 places it in the queue and then runs the GV
$SQLTEXT_WITH_NEWLINES query you pointed out to get SQL text. When the
query is executed, the SQL text is updated in the User Interface. In
some cases, Lab128 wants to store SQL text for some expensive queries
so it will place this SQL IDs in the queue automatically.
To avoid flooding of queries against GV$SQLTEXT_WITH_NEWLINES, the
query is scheduled every 2 seconds by default. This can be changed by
Main menu | Measurement | Query Editor ad then finding sql_text_cache
query and changing "Time Between Measurements". More about this screen
can be learned from Help - press F1.
There were bugs in some Oracle versions causing long executions of
queries on GV$SQLTEXT_WITH_NEWLINES view. Which Oracle version?
Sergei