gpt4 book ai didi

mysql - MySQL中 "Partition"关键字有什么用?

转载 作者:行者123 更新时间:2023-11-29 01:34:00 25 4
gpt4 key购买 nike

因为我是一个 MySQL 新手。这条 MySQL 语句中的 PARTITION 是什么意思?

CREATE TABLE employees (
id INT NOT NULL,
fname VARCHAR(30),
lname VARCHAR(30),
hired DATE NOT NULL DEFAULT '1970-01-01',
separated DATE NOT NULL DEFAULT '9999-12-31',
job_code INT NOT NULL,
store_id INT NOT NULL
)
PARTITION BY RANGE (store_id) (
PARTITION p0 VALUES LESS THAN (6),
PARTITION p1 VALUES LESS THAN (11),
PARTITION p2 VALUES LESS THAN (16),
PARTITION p3 VALUES LESS THAN (21)
);

最佳答案

Partitioning is a way of pre-organizing table storage. You can say "some of the table's rows will go here, some will go there, still others will go to to still other places". Often, depending on the storage engine, the effect is to spread the table's rows over different files or even different disks.

发件人:MySQL 5.1 New Features: MySQL Partitions


您可能还对寻求有关“horizontal partitioning”的更多信息感兴趣,以便更好地了解它特别有用的场景。

关于mysql - MySQL中 "Partition"关键字有什么用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2559925/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com