Skip to content

[Bug]: sum(mo_table_size) takes long time for the database with more than 20000 tables #17366

Closed

Description

@DanielZhangQD

Is there an existing issue for the same bug?

  • I have checked the existing issues.

Branch Name

1.2.1

Commit ID

v1.2.1-27b34c670-2024-06-28

Other Environment Information

- Hardware parameters:
- OS type:
- Others:

Actual Behavior

  • DB write_test_0424 has 22268 tables
  • The following SQL takes more than 10 minutes:
mysql> select request_at,statement,statement_id,status,duration from system.statement_info where request_at > '2024-07-05 07:50:00' and statement_id = '019081e8-c056-7bf1-9c70-2b1ee674983d';
| 2024-07-05 08:00:32.854620 | explain analyze SELECT reldatabase, sum(mo_table_size (reldatabase, relname)) AS size FROM `mo_catalog`.`mo_tables` WHERE relkind in ('r','e','cluster','v') AND reldatabase in ('mo_catalog','gh_monitor','write_test_mo_mysql','mo_sample_data_tpch_sf10','saas_common','write_test_0424','system','system_metrics','information_schema','mo_sample_data_tpch_sf1','mysql','write_test','write_test_mo_mysql2','write_test_mo_mysql3','test') GROUP BY `reldatabase` | 019081e8-c056-7bf1-9c70-2b1ee674983d | Success | 600162520634 |

Expected Behavior

SQL succeeds in reasonable time

Steps to Reproduce

See detail in `Actual Behavior`

Additional information

Cloud prod env

Activity

  1. added
    kind/bug
    severity/s0
    on Jul 8, 2024
  2. added this to the 1.3.0 milestone on Jul 8, 2024
  3. changed the title [-][Bug]: `mo_table_size` takes long time for the database with more than 20000 tables[/-] [+][Bug]: `sum(mo_table_size)` takes long time for the database with more than 20000 tables[/+] on Jul 8, 2024
  4. DanielZhangQD commented on Jul 8, 2024

    @DanielZhangQD
    ContributorAuthor
  5. XuPeng-SH commented on Jul 8, 2024

    @XuPeng-SH
    Contributor

    depends #15708

  6. gouhongshen commented on Jul 11, 2024

    @gouhongshen
    Contributor

    waiting

  7. gouhongshen commented on Jul 16, 2024

    @gouhongshen
    Contributor

    在做 partition state 重构

  8. gouhongshen commented on Jul 19, 2024

    @gouhongshen
    Contributor

    在做 reader

  9. gouhongshen commented on Jul 25, 2024

    @gouhongshen
    Contributor

    在做 reader

  10. 6 remaining items

  11. modified the milestones: 2.0.1, 2.1.0 on Nov 12, 2024
  12. gouhongshen commented on Nov 28, 2024

    @gouhongshen
    Contributor

    2.0 已经 merge

  13. modified the milestones: 2.1.0, 2505 on Apr 25, 2025
  14. added theissue type on Apr 25, 2025
  15. ghost closed this as completedon Jun 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugphase/testingseverity/s0

    Type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions