Skip to content

TiFlash consume much memory than expected with large number of ENUM columns #9947

@JaySon-Huang

Description

@JaySon-Huang

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

Create 36,000 table with schema like

CREATE TABLE IF NOT EXISTS enum_tbl_000 ( field1 VARCHAR(255), field2 VARCHAR(255), field3 VARCHAR(255),  enum1 ENUM('T', 'F'), enum2 ENUM('T', 'F'), enum3 ENUM('T', 'F'), enum4 ENUM('T', 'F'), enum5 ENUM('T', 'F'), enum6 ENUM('T', 'F'), enum7 ENUM('T', 'F'), enum8 ENUM('T', 'F'), enum9 ENUM('T', 'F'), enum10 ENUM('T', 'F'), enum11 ENUM('T', 'F'), enum12 ENUM('T', 'F'), enum13 ENUM('T', 'F'), enum14 ENUM('T', 'F'), enum15 ENUM('T', 'F'), enum16 ENUM('T', 'F'), enum17 ENUM('T', 'F'), enum18 ENUM('T', 'F'), enum19 ENUM('T', 'F'),  enum20 ENUM('pending', 'running', 'finished', 'failed'), enum21 ENUM('DEFAULT', 'ALL', 'PREDICATE', 'LIST'), enum22 ENUM('NONE', 'READ', 'INTEND', 'WRITE') ) DEFAULT CHARSET=utf8mb4;

Check the memory consumption of tiflash process

2. What did you expect to see? (Required)

3. What did you see instead (Required)

There are about 13,000 tables with 60 enum column in each table, turning into 780,000 DataTypeEnum instances. They takes about 4GB memory.

before_share_enum.svg.zip

Image

4. What is your TiFlash version? (Required)

nightly, v8.5.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    affects-6.5This bug affects the 6.5.x(LTS) versions.affects-7.1This bug affects the 7.1.x(LTS) versions.affects-7.5This bug affects the 7.5.x(LTS) versions.affects-8.1This bug affects the 8.1.x(LTS) versions.affects-8.5This bug affects the 8.5.x(LTS) versions.component/storageseverity/majortype/bugThe issue is confirmed as a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions