Skip to content

Add local/global scope modifiers for the db-info performance counters - #8771

Merged
dyemanov merged 2 commits into
masterfrom
work/info-counters-scope
Oct 21, 2025
Merged

Add local/global scope modifiers for the db-info performance counters#8771
dyemanov merged 2 commits into
masterfrom
work/info-counters-scope

Conversation

@dyemanov

@dyemanov dyemanov commented Oct 10, 2025

Copy link
Copy Markdown
Member

There are two goals for this change:

  1. Fix ISQL's SET STAT; to report local (current connection) page counters instead of global (per database) counters, as it makes performance analysis hardly possible under concurrent load in SuperServer. There will be a separate PR for that.
  2. Allow collection of database-wise performance counters using only Attachment::getInfo(), without any MON$ table access.

New scope tags are allowed to be intermixed inside a single info buffer, every scope tag affects only counters requested after it. Thus it's possible to collect e.g. per-database page counters and per-attachment record counters using a single API call, if this would be ever required. Scope tags are returned "as is" inside the output buffer (for consistency).

If scope tags are missing, the legacy behaviour (per-database page and memory counters, per-attachment record counters) is preserved for backward compatibility.

@dyemanov

Copy link
Copy Markdown
Member Author

Honestly, I'm not sure global vs local memory usage counters have much practical usage, but it's supported in this PR just in case anyone finds it useful.

@aafemt

aafemt commented Oct 10, 2025

Copy link
Copy Markdown
Contributor

AFAICS only 6 counters are affected by flags. IMHO, it would be more clear to create 6 new info items instead.

@dyemanov

Copy link
Copy Markdown
Member Author

AFAICS only 6 counters are affected by flags. IMHO, it would be more clear to create 6 new info items instead.

4 page counters, 2 memory counters and 8 record counters are affected. And we may have more in the future.

@hvlad hvlad left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer, but not insist, to see
fb_info_counts_scope_attachment, fb_info_counts_scope_database
instead of
fb_info_counts_scope_local, fb_info_counts_scope_global

@AlexPeshkoff

Copy link
Copy Markdown
Member

I prefer, but not insist, to see fb_info_counts_scope_attachment, fb_info_counts_scope_database instead of fb_info_counts_scope_local, fb_info_counts_scope_global

On my mind that should better be fb_info_counts_scope_private and fb_info_counts_scope_shared (typical for OS names), but I also do not insist.

@dyemanov
dyemanov merged commit 2cac6fc into master Oct 21, 2025
36 checks passed
@dyemanov
dyemanov deleted the work/info-counters-scope branch October 21, 2025 05:39
dyemanov added a commit that referenced this pull request Oct 27, 2025
@mrotteveel mrotteveel added the rlsnotes60: yes Already added to the Firebird 6.0 release notes. (Do not add this to signal it should be added.) label Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix-version: 6.0 Alpha 1 rlsnotes60: yes Already added to the Firebird 6.0 release notes. (Do not add this to signal it should be added.) type: improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants