代码之家  ›  专栏  ›  技术社区  ›  IvanV

MySQL数据库8。创建的表太慢

  •  0
  • IvanV  · 技术社区  · 2 年前

    空服务器。Ubuntu 22.04版本
    空数据库。MySQL 8.0.33版本。
    InnoDB表

    为什么每次创建表格的时间从0.6秒到1秒。 只有3-4列。没有数据。

    mysql> show profile for query 1;
    +-------------------------------+----------+
    | Status                        | Duration |
    +-------------------------------+----------+
    | starting                      | 0.000181 |
    | Executing hook on transaction | 0.000181 |
    | starting                      | 0.000030 |
    | checking permissions          | 0.000013 |
    | creating table                | 0.733726 |
    | After create                  | 0.000674 |
    | waiting for handler commit    | 0.000025 |
    | waiting for handler commit    | 0.088327 |
    | query end                     | 0.000022 |
    | closing tables                | 0.000008 |
    | waiting for handler commit    | 0.000035 |
    | freeing items                 | 0.000037 |
    | cleaning up                   | 0.000047 |
    +----------------------+----------+
    14 rows in set, 1 warning (0.00 sec)
    
    0 回复  |  直到 2 年前