database partitioning - On MySQL 5.1, how can I query a specific partition? -
database partitioning - On MySQL 5.1, how can I query a specific partition? -
i need run query on partitioned table, , i'd result partition, so:
partition result count ----------- ---------- ------ p1 apples 2 p1 oranges 3 p2 apples 10 p2 oranges 15
from official mysql docs online, if had 5.6 or later, we'd able utilize partition clause specify info from, we're stuck @ 5.1.63. there easy way this, regardless of partitioning scheme of table?
i don't believe can in mysql 5.1.
you can work around though - whatever partition definition can add together same status count.
for illustration if range partition on id column , p1 id < 10000, p2 id < 20000 then
select result, partition, count(id) ( select result, id, case when id < 10000 p1 when id < 20000 p2 ..... end partition table ) s1 grouping partition, result
mysql database-partitioning
Comments
Post a Comment