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

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

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

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 with detail;

+------------------------+-----------+--------------+-------------+-----------------+-----------------+-----------------+-----------------+
| TableName              | Size      | ReplicaCount | RemoteSize  | LocalInvertedSize | LocalSegmentSize | RemoteInvertedSize | RemoteSegmentSize |
+------------------------+-----------+--------------+-------------+-----------------+-----------------+-----------------+-----------------+
| test_show_index_data_p2 | 291.534 MB | 1           | 0.000       | 157.837 MB       | 133.697 MB       | 0.000           | 0.000           |
| Total                  | 291.534 MB | 1           | 0.000       | 157.837 MB       | 133.697 MB       | 0.000           | 0.000           |
| Quota                  | 1024.000 TB | 1073741824  |             |                  |                 |                 |                 |
| Left                   | 1024.000 TB | 1073741823  |             |                  |                 |                 |                 |
+------------------------+-----------+--------------+-------------+-----------------+-----------------+-----------------+-----------------+
4 rows in set (0.00 sec)
msql> show data with detail from test_show_index_data_p2;
+------------------------+------------------------+-----------+--------------+----------+-------------+-----------------+-----------------+-----------------+-----------------+
| TableName              | IndexName              | Size      | ReplicaCount | RowCount | RemoteSize  | LocalInvertedSize | LocalSegmentSize | RemoteInvertedSize | RemoteSegmentSize |
+------------------------+------------------------+-----------+--------------+----------+-------------+-----------------+-----------------+-----------------+-----------------+
| test_show_index_data_p2 | test_show_index_data_p2 | 291.534 MB | 1           | 19697882 | 0.000       | 157.837 MB       | 133.697 MB       | 0.000           | 0.000           |
|                        | Total                  | 291.534 MB | 1           |          | 0.000       | 157.837 MB       | 133.697 MB       | 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 with detail; 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

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

Successfully merging this pull request may close these issues.

2 participants