MySQL Forums
Forum List  »  Partitioning

Indexes Cardinality is NULL on Partitioned tables.
Posted by: Rushi Vishavadia
Date: November 19, 2008 01:32AM

Hi,

I'm doing some testing with partitioned tables and I'm having some issues with indexes. Here I have just created a test table:

-- Simple table partitioned on date.
drop table by_month;
CREATE TABLE by_month (
d DATE,
i int(4),
KEY(i)
)
PARTITION BY RANGE (TO_DAYS(d))
(
PARTITION P1 VALUES LESS THAN (to_days('2001-02-01')),
PARTITION P2 VALUES LESS THAN (to_days('2001-03-01')),
PARTITION P3 VALUES LESS THAN (to_days('2001-04-01')),
PARTITION P4 VALUES LESS THAN (MAXVALUE)
);

-- I insert a bunch of data, say 10 rows via simple inserts
insert into by_month values('2001-01-01','1314645');

mysql> show indexes from by_month;
+----------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+
| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment |
+----------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+
| by_month | 1 | i | 1 | i | A | NULL | NULL | NULL | YES | BTREE | |
+----------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+


Why is the cardinality NULL ? If I execute a "repair table by_month" it fixes the indexes and the cardinality shows up fine.

I checked the .MYI file, and it was built fine. I've tried this on several servers and I am having the same problem. Any clues?

Options: ReplyQuote


Subject
Views
Written By
Posted
Indexes Cardinality is NULL on Partitioned tables.
5205
November 19, 2008 01:32AM


Sorry, you can't reply to this topic. It has been closed.

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.