Skip to content

Work/isql per table stats#7218

Merged
hvlad merged 3 commits intomasterfrom
work/isql-perTableStats
Jul 1, 2022
Merged

Work/isql per table stats#7218
hvlad merged 3 commits intomasterfrom
work/isql-perTableStats

Conversation

@hvlad
Copy link
Copy Markdown
Member

@hvlad hvlad commented Jun 24, 2022

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

Comment thread src/isql/isql.epp

const char* PerTableStats::m_itemNames[] =
{
" Natural", " Index",
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.

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

Copy link
Copy Markdown
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.

Comment thread src/isql/isql.epp Outdated
Firebird::string sIds;

unsigned maxLen = 0;
USHORT relId = ~0;
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.

Here you can also do the same and use MAX_USHORT.

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

aafemt commented Jul 1, 2022

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

@hvlad
Copy link
Copy Markdown
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
Copy Markdown

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