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

[feat] (inverted index) show index file size #44120

Merged
merged 20 commits into from
Dec 2, 2024

Conversation

csun5285
Copy link
Contributor

@csun5285 csun5285 commented Nov 18, 2024

What problem does this PR solve?

Problem Summary:

  1. Show the data in detail, including the size of the inverted index file and the data file.
mysql > show data all;

+------------------------+-----------+--------------+-------------+-----------------+-----------------+-----------------+-----------------+
| TableName              | ReplicaCount      | LocalTotalSize| LocalDataSize  | LocalIndexSize | RemoteTotalSize| RemoteDataSize | RemoteIndexSize |
+------------------------+-----------+--------------+-------------+-----------------+-----------------+-----------------+-----------------+
| test_show_index_data_p2 |  1 | 291.534 MB          | 133.697 MB      | 157.837 MB       | 0.000      | 0.000           | 0.000           |
| Total                  | 1 | 291.534 MB          | 133.697 MB       | 157.837 MB       |   0.000      | 0.000           | 0.000           |
| Quota                  | 1024.000 TB | 1073741824  |             |                  |                 |                 |                 |
| Left                   | 1024.000 TB | 1073741823  |             |                  |                 |                 |                 |
+------------------------+-----------+--------------+-------------+-----------------+-----------------+-----------------+-----------------+
4 rows in set (0.00 sec)
msql> show data all from test_show_index_data_p2;
+------------------------+------------------------+-----------+--------------+----------+-------------+-----------------+-----------------+-----------------+-----------------+
| TableName              | IndexName              | ReplicaCount      |  RowCount| LocalTotalSize | LocalDataSize  | LocalIndexSize | RemoteTotalSize | RemoteDataSize | RemoteIndexSize |
+------------------------+------------------------+-----------+--------------+----------+-------------+-----------------+-----------------+-----------------+-----------------+
| test_show_index_data_p2 | test_show_index_data_p2 | 1 | 19697882          | 291.534 MB | 157.837 MB       |     133.697 MN    | 0.000       | 0.000           | 0.000           |
|                        | Total                  | 1 |            |    291.534 MB      | 133.697 MB       | 157.837 MB       |   0.000    | 0.000           | 0.000           |
+------------------------+------------------------+-----------+--------------+----------+-------------+-----------------+-----------------+-----------------+-----------------+
2 rows in set (0.00 sec)
  1. It is possible to obtain the sizes of data and index files by querying the system tables
msyql > select * from information_schema.tables where TABLE_NAME = "test_show_index_data_p2";
+-------------------------+-------------------------------+---------------------+----------------+-------------+-------------+-------------+------------+------------+---------------------+---------------------+------------+---------+------------+---------------+----------------+
| TABLE_CATALOG           | TABLE_SCHEMA                                    | TABLE_NAME          | TABLE_TYPE     | ENGINE      | VERSION     | ROW_FORMAT  | TABLE_ROWS | AVG_ROW_LENGTH | DATA_LENGTH | MAX_DATA_LENGTH | INDEX_LENGTH | DATA_FREE | AUTO_INCREMENT | CREATE_TIME          | UPDATE_TIME          | CHECK_TIME | TABLE_COLLATION | CHECKSUM | CREATE_OPTIONS | TABLE_COMMENT |
+-------------------------+-------------------------------+---------------------+----------------+-------------+-------------+-------------+------------+--------------+-------------+----------------+--------------+-----------+---------------+---------------------+---------------------+------------+----------------+---------+---------------+---------------+
| internal                | regression_test_inverted_index_p2_show_data | test_show_index_data_p2 | BASE TABLE  | Doris       | NULL        | NULL        | 19697882    | 15            | 140191631   | NULL          | 165504277   | NULL      | NULL          | 2024-11-18 15:22:32 | 2024-11-18 15:24:52 | NULL       | utf-8           | NULL     | NULL          |               |
+-------------------------+-------------------------------+---------------------+----------------+-------------+-------------+-------------+------------+--------------+-------------+----------------+--------------+-----------+---------------+---------------------+---------------------+------------+----------------+---------+---------------+---------------+
1 row in set (0.02 sec)

Release note

  1. Added show data all; to retrieve the detailed file size.
  2. Fixed the semantics of DATA_LENGTH and INDEX_LENGTH in the system table information_schema.tables.

Check List (For Author)

  • Test

    • Regression test
    • Unit Test
    • Manual test (add detailed scripts or steps below)
    • No need to test or manual test. Explain why:
      • This is a refactor/code format and no logic has been changed.
      • Previous test can cover this change.
      • No code files have been changed.
      • Other reason
  • Behavior changed:

    • No.
    • Yes.

DATA_LENGTH in the system table information_schema.tables represents the segment file size, while INDEX_LENGTH represents the size of the inverted index file

  • Does this need documentation?
    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

@doris-robot
Copy link

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@csun5285
Copy link
Contributor Author

run buildall

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@csun5285
Copy link
Contributor Author

run buildall

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@csun5285 csun5285 changed the title [imporve] (inverted index) show index file size [improve] (inverted index) show index file size Nov 18, 2024
@csun5285
Copy link
Contributor Author

run buildall

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 37.97% (9897/26068)
Line Coverage: 29.16% (82750/283738)
Region Coverage: 28.30% (42485/150120)
Branch Coverage: 24.87% (21542/86618)
Coverage Report: http://coverage.selectdb-in.cc/coverage/a85b0d01ad9f39067a2da06f3f63e1ea56b14d2a_a85b0d01ad9f39067a2da06f3f63e1ea56b14d2a/report/index.html

@csun5285
Copy link
Contributor Author

run buildall

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 38.00% (9897/26044)
Line Coverage: 29.17% (82749/283662)
Region Coverage: 28.31% (42489/150102)
Branch Coverage: 24.88% (21552/86628)
Coverage Report: http://coverage.selectdb-in.cc/coverage/d8a528423a321170544b1d44decf6a75dc16ad0c_d8a528423a321170544b1d44decf6a75dc16ad0c/report/index.html

@csun5285
Copy link
Contributor Author

run buildall

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@csun5285
Copy link
Contributor Author

run buildall

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@csun5285
Copy link
Contributor Author

run buildall

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 38.00% (9897/26046)
Line Coverage: 29.17% (82742/283626)
Region Coverage: 28.31% (42492/150100)
Branch Coverage: 24.87% (21544/86620)
Coverage Report: http://coverage.selectdb-in.cc/coverage/58b66cd71a74663b502981bf681593ab838de10d_58b66cd71a74663b502981bf681593ab838de10d/report/index.html

@csun5285
Copy link
Contributor Author

run p1

@csun5285
Copy link
Contributor Author

run cloud_p1

@csun5285
Copy link
Contributor Author

run buildall

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 38.00% (9898/26046)
Line Coverage: 29.18% (82763/283627)
Region Coverage: 28.31% (42496/150100)
Branch Coverage: 24.88% (21551/86620)
Coverage Report: http://coverage.selectdb-in.cc/coverage/3ff904be13de1471537d6faca0644e0a695cc0a5_3ff904be13de1471537d6faca0644e0a695cc0a5/report/index.html

@csun5285
Copy link
Contributor Author

run p1

@csun5285
Copy link
Contributor Author

run cloud_p1

@csun5285
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 38.32% (9975/26029)
Line Coverage: 29.43% (83541/283845)
Region Coverage: 28.57% (42991/150458)
Branch Coverage: 25.19% (21834/86694)
Coverage Report: http://coverage.selectdb-in.cc/coverage/74d00b516b05b32199c01c69b3a94b4c1705952b_74d00b516b05b32199c01c69b3a94b4c1705952b/report/index.html

@airborne12 airborne12 changed the title [improve] (inverted index) show index file size [feat] (inverted index) show index file size Nov 28, 2024
Copy link
Member

@airborne12 airborne12 left a comment

Choose a reason for hiding this comment

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

LGTM

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Nov 28, 2024
Copy link
Contributor

PR approved by at least one committer and no changes requested.

Copy link
Contributor

PR approved by anyone and no changes requested.

Copy link
Member

@eldenmoon eldenmoon left a comment

Choose a reason for hiding this comment

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

LGTM

@airborne12 airborne12 merged commit fa13a70 into apache:master Dec 2, 2024
22 of 26 checks passed
github-actions bot pushed a commit that referenced this pull request Dec 2, 2024
### What problem does this PR solve?

Problem Summary:

1. Show the data in detail, including the size of the inverted index
file and the data file.

```
mysql > show data all;

+------------------------+-----------+--------------+-------------+-----------------+-----------------+-----------------+-----------------+
| TableName              | ReplicaCount      | LocalTotalSize| LocalDataSize  | LocalIndexSize | RemoteTotalSize| RemoteDataSize | RemoteIndexSize |
+------------------------+-----------+--------------+-------------+-----------------+-----------------+-----------------+-----------------+
| test_show_index_data_p2 |  1 | 291.534 MB          | 133.697 MB      | 157.837 MB       | 0.000      | 0.000           | 0.000           |
| Total                  | 1 | 291.534 MB          | 133.697 MB       | 157.837 MB       |   0.000      | 0.000           | 0.000           |
| Quota                  | 1024.000 TB | 1073741824  |             |                  |                 |                 |                 |
| Left                   | 1024.000 TB | 1073741823  |             |                  |                 |                 |                 |
+------------------------+-----------+--------------+-------------+-----------------+-----------------+-----------------+-----------------+
4 rows in set (0.00 sec)
```

```
msql> show data all from test_show_index_data_p2;
+------------------------+------------------------+-----------+--------------+----------+-------------+-----------------+-----------------+-----------------+-----------------+
| TableName              | IndexName              | ReplicaCount      |  RowCount| LocalTotalSize | LocalDataSize  | LocalIndexSize | RemoteTotalSize | RemoteDataSize | RemoteIndexSize |
+------------------------+------------------------+-----------+--------------+----------+-------------+-----------------+-----------------+-----------------+-----------------+
| test_show_index_data_p2 | test_show_index_data_p2 | 1 | 19697882          | 291.534 MB | 157.837 MB       |     133.697 MN    | 0.000       | 0.000           | 0.000           |
|                        | Total                  | 1 |            |    291.534 MB      | 133.697 MB       | 157.837 MB       |   0.000    | 0.000           | 0.000           |
+------------------------+------------------------+-----------+--------------+----------+-------------+-----------------+-----------------+-----------------+-----------------+
2 rows in set (0.00 sec)
```

2. It is possible to obtain the sizes of data and index files by
querying the system tables

```
msyql > select * from information_schema.tables where TABLE_NAME = "test_show_index_data_p2";
+-------------------------+-------------------------------+---------------------+----------------+-------------+-------------+-------------+------------+------------+---------------------+---------------------+------------+---------+------------+---------------+----------------+
| TABLE_CATALOG           | TABLE_SCHEMA                                    | TABLE_NAME          | TABLE_TYPE     | ENGINE      | VERSION     | ROW_FORMAT  | TABLE_ROWS | AVG_ROW_LENGTH | DATA_LENGTH | MAX_DATA_LENGTH | INDEX_LENGTH | DATA_FREE | AUTO_INCREMENT | CREATE_TIME          | UPDATE_TIME          | CHECK_TIME | TABLE_COLLATION | CHECKSUM | CREATE_OPTIONS | TABLE_COMMENT |
+-------------------------+-------------------------------+---------------------+----------------+-------------+-------------+-------------+------------+--------------+-------------+----------------+--------------+-----------+---------------+---------------------+---------------------+------------+----------------+---------+---------------+---------------+
| internal                | regression_test_inverted_index_p2_show_data | test_show_index_data_p2 | BASE TABLE  | Doris       | NULL        | NULL        | 19697882    | 15            | 140191631   | NULL          | 165504277   | NULL      | NULL          | 2024-11-18 15:22:32 | 2024-11-18 15:24:52 | NULL       | utf-8           | NULL     | NULL          |               |
+-------------------------+-------------------------------+---------------------+----------------+-------------+-------------+-------------+------------+--------------+-------------+----------------+--------------+-----------+---------------+---------------------+---------------------+------------+----------------+---------+---------------+---------------+
1 row in set (0.02 sec)

```

### Release note

1. Added `show data all;` to retrieve the detailed file size.
2. Fixed the semantics of `DATA_LENGTH` and `INDEX_LENGTH` in the system
`table information_schema.tables`.
airborne12 pushed a commit that referenced this pull request Dec 3, 2024
airborne12 pushed a commit that referenced this pull request Dec 17, 2024
### What problem does this PR solve?

Related PR: #44120

Problem Summary:

- `detached tablet stats` should maintain a fixed size.
github-actions bot pushed a commit that referenced this pull request Dec 17, 2024
### What problem does this PR solve?

Related PR: #44120

Problem Summary:

- `detached tablet stats` should maintain a fixed size.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by one committer. dev/3.0.4-merged reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants