gpt4 book ai didi

mysql - mysql 中的分区是创建表还是仅仅创建虚拟表?

转载 作者:行者123 更新时间:2023-11-29 14:31:03 24 4
gpt4 key购买 nike

当在 mysql 中完成分区时,它会创建表还是创建虚拟表(即 View ),这些表几乎是通过表名称访问的存储查询?

这是一个来自 http://www.devarticles.com/c/a/Oracle/Partitioning-in-Oracle/1/ 的示例(尽管在 Oracle 中,这只是用作示例 - 我最好奇的是它在 mysql 中是如何处理的) :

CREATE TABLE SAMPLE_ORDERS
(ORDER_NUMBER NUMBER,
ORDER_DATE DATE,
CUST_NUM NUMBER,
TOTAL_PRICE NUMBER,
TOTAL_TAX NUMBER,
TOTAL_SHIPPING NUMBER)
PARTITION BY RANGE(ORDER_DATE)
(
PARTITION SO99Q1 VALUES LESS THAN TO_DATE(‘01-APR-1999’, ‘DD-MON-YYYY’),
PARTITION SO99Q2 VALUES LESS THAN TO_DATE(‘01-JUL-1999’, ‘DD-MON-YYYY’),
PARTITION SO99Q3 VALUES LESS THAN TO_DATE(‘01-OCT-1999’, ‘DD-MON-YYYY’),
PARTITION SO99Q4 VALUES LESS THAN TO_DATE(‘01-JAN-2000’, ‘DD-MON-YYYY’),
PARTITION SO00Q1 VALUES LESS THAN TO_DATE(‘01-APR-2000’, ‘DD-MON-YYYY’),
PARTITION SO00Q2 VALUES LESS THAN TO_DATE(‘01-JUL-2000’, ‘DD-MON-YYYY’),
PARTITION SO00Q3 VALUES LESS THAN TO_DATE(‘01-OCT-2000’, ‘DD-MON-YYYY’),
PARTITION SO00Q4 VALUES LESS THAN TO_DATE(‘01-JAN-2001’, ‘DD-MON-YYYY’)
)
;

最佳答案

根据Mysql 5.6引用手册(16.1 MySQL分区概述):

Partitioning takes this notion a step further, by enabling you to distribute portions of individual tables across a file system according to rules which you can set largely as needed. In effect, different portions of a table are stored as separate tables in different locations.

关于mysql - mysql 中的分区是创建表还是仅仅创建虚拟表?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10035498/

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