Bug #20279 Can't select data from a specific partition
| Submitted: | 6 Jun 2006 5:23 | Modified: | 24 May 2012 11:35 |
|---|---|---|---|
| Reporter: | carlos mafla | Email Updates: | |
| Status: | Closed | Impact on me: | |
| Category: | MySQL Server: Partitions | Severity: | S4 (Feature request) |
| Version: | 5.1.9-beta | OS: | Linux (CentOS release 4.2 (Final)) |
| Assigned to: | CPU Architecture: | Any |
[6 Jun 2006 5:23]
carlos mafla
[4 Oct 2008 20:57]
Konstantin Osipov
Subpartitions are not tables and can not be accessed independently from main tables. If you would like to query an individual partition, please use a different partitioning (not by hash) and specify the partitioning clause in the WHERE.
[29 Jul 2009 13:24]
Oli Sennhauser
Hi all An other customer is requesting what they know from other RDBMS: SELECT * FROM table (PARTITION #12);
[8 Sep 2010 12:35]
Suresh Chary
I have a similar requirement. Did you get the answer to check the data partition-wise?
[15 Dec 2010 1:56]
Meiji KIMURA
If you want to know 'count(*)' from specific partition like this, SELECT count(*) FROM partition_hash PARTITION(p3); you can use this query as alternative. mysql> SELECT table_rows as 'count(*)' FROM information_schema.partitions WHERE table_schema = schema() and table_name = 'partition_hash' and partition_name = 'p3'; +----------+ | count(*) | +----------+ | 2 | +----------+ 1 row in set (0.01 sec)
[26 Jan 2011 22:09]
Mattias Jonsson
This feature is being implemented as WL#5217. Do not use the above workaround for InnoDB (I_S.PARTITIONS.table_rows), since it will not be correct, only an approximation. It will be exact for MyISAM though.
[24 May 2012 11:35]
Mattias Jonsson
Added to MySQL 5.6: http://dev.mysql.com/doc/refman/5.6/en/partitioning-selection.html
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.058 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the
respective copyright holders.
It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.