Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add MON$ELAPSED_TIME to MON$STATEMENTS [CORE6471] #6702

Open
firebird-automations opened this issue Jan 21, 2021 · 4 comments
Open

Add MON$ELAPSED_TIME to MON$STATEMENTS [CORE6471] #6702

firebird-automations opened this issue Jan 21, 2021 · 4 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @livius2

Add cumulative time during query execution. Query can be be stalled and active back in long intervals but it can be relative short as a whole.

Look at discussion with Vlad Khorsun in CORE6456 maybe you find more fields/statistics to add.

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

The problem is that measuring time also takes time, thus affecting performance. And given that you need to exclude "stalled" intervals, timer should be reset for the every fetched record. For trivial queries that return many rows it may be an overkill.

IMO, it should be either configurable (and disabled by default), or moved to the trace side (which is already optional and configurable), or be part of the SQL profiler feature that was discussed in fb-devel.

@firebird-automations
Copy link
Collaborator Author

Commented by: @livius2

First we must define what "stalled" mean and what really is needed (maybe other word).

I need to calculate time when there is request from client to server to retrive data for this query.
Because this calculation " timer should be reset for the every fetched record" is not needed.
As client do not ask server for every record, this will be overkill in round trips from client to server i suppose.

We only need to exclude time when client do not read data from the server.
Maybe something like MON$READ_TOTAL_TIME and MON$READ_IDLE_TIME will be better here and easier to calculate without affecting performance instead of MON$ELAPSED_TIME which will be ideal but...

Or any other proposition that satisfy needs :)

@firebird-automations
Copy link
Collaborator Author

Commented by: @livius2

As Firebird4 is RC and near to release, some question arrise - "Statement Timeout".
Will this stalled query be timeouted? Or timeout is calculated on real query execution time?

@firebird-automations
Copy link
Collaborator Author

Commented by: @hvlad

Karol,

in short: yes, stalled query could be timed out.

Actually, your question is already answered in Release Notes, see "How the Statement Timeout Works" at "Chapter 3. Changes in the Firebird Engine".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant