I have a MySQL table with 20 million rows. I want to partition to boost speed. The table is in the following format:
column column column sector
data data data Capital Goods
data data data Transportation
data data data Technology
data data data Technology
data data data Capital Goods
data data data Finance
data data data Finance
I have applied partitions using the following code:
ALTER TABLE technical
PARTITION BY LIST COLUMNS (sector)
(
PARTITION P1 VALUES IN ('Capital Goods'),
PARTITION P2 VALUES IN ('Health Care'),
PARTITION P3 VALUES IN ('Transportation'),
PARTITION P4 VALUES IN ('Finance'),
PARTITION P5 VALUES IN ('Technology'),
PARTITION P6 VALUES IN ('Consumer Services'),
PARTITION P7 VALUES IN ('Energy'),
PARTITION P8 VALUES IN ('Healthcare'),
PARTITION P9 VALUES IN ('Consumer Non-Durables'),
PARTITION P10 VALUES IN ('Consumer Durables')
);
Its all fine so far, but when I look at the table through phpMyAdmin it displays this:
How can sector
be less than capital goods
?
What am I doing wrong?
The problem is simply phpMyAdmin reresenting the data in an unusual way. The database is now working as expected and queries such as:
SELECT * WHERE ... AND sector = "Energy"
are running much faster.
Thanks to Drew, Uueerdo, Rick James and everybody else for helping me understand this problem.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.