Skip to content

Work/isql per table stats #7218

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

Merged
merged 3 commits into from
Jul 1, 2022
Merged

Work/isql per table stats #7218

merged 3 commits into from
Jul 1, 2022

Conversation

hvlad
Copy link
Member

@hvlad hvlad commented Jun 24, 2022

Per-table run-time statistics in isql.
Details in doc\README.isql_enhancements.txt


const char* PerTableStats::m_itemNames[] =
{
" Natural", " Index",
Copy link
Member

Choose a reason for hiding this comment

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

It would be cleaner if you use the space in the printf usage instead of in each array member.

Copy link
Member Author

Choose a reason for hiding this comment

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

It allows to easily manage alignment and indentation of header names and see it "right now", without compile and run.

Firebird::string sIds;

unsigned maxLen = 0;
USHORT relId = ~0;
Copy link
Member

Choose a reason for hiding this comment

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

Here you can also do the same and use MAX_USHORT.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

Table name | Natural | Index | Insert | Update | Delete | Backout | Purge | Expunge |
--------------------------------+---------+---------+---------+---------+---------+---------+---------+---------+
RDB$INDICES | | 3| | | | | | |
RDB$RELATION_FIELDS | | 534| | | | | | |
Copy link
Member

Choose a reason for hiding this comment

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

Since you have one space in the headers, why not have a space after the numbers?

Copy link
Member Author

Choose a reason for hiding this comment

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

Output is already very wide. Also, I satisfied how it looks even without space after numbers :)

Also, reset table names cache when new database is connected.
@hvlad hvlad self-assigned this Jun 26, 2022
@hvlad hvlad merged commit 885ff64 into master Jul 1, 2022
@hvlad hvlad deleted the work/isql-perTableStats branch July 1, 2022 08:49
@aafemt
Copy link
Contributor

aafemt commented Jul 1, 2022

You forgot to add the new setting into "HELP SET" text.

@hvlad
Copy link
Member Author

hvlad commented Jul 3, 2022

You forgot to add the new setting into "HELP SET" text.

Done, thanks for reminding me.

@pavel-zotov
Copy link

QA: see functional/basic/isql/test_06.py

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

Successfully merging this pull request may close these issues.

4 participants