MySQL Forums
Forum List  »  Partitioning

Partition using non primary key
Posted by: dileep ch
Date: April 04, 2012 10:57PM

I've a table structure like this, i could not create a partiton on a non primary key column. Please give me the solution for this.

Table: sessions
Create Table: CREATE TABLE `sessions` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`session_start_time` bigint(20) NOT NULL,
`session_end_time` bigint(20) NOT NULL,
`os_version` int(11) NOT NULL,
`app_version` int(11) NOT NULL,
`device_version` int(11) NOT NULL,
`lat` float NOT NULL DEFAULT '0',
`longi` float NOT NULL DEFAULT '0',
`country_id` int(11) NOT NULL,
`ip` int(32) NOT NULL,
`udid` int(11) NOT NULL,
`cdate` date NOT NULL DEFAULT '0000-00-00',
`ctime` time NOT NULL DEFAULT '00:00:00',
`level_id` int(11) NOT NULL DEFAULT '0',
`jail_broken` tinyint(4) NOT NULL DEFAULT '0',
`jail_broken2` tinyint(4) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `udid` (`udid`),
KEY `country_id` (`country_id`),
KEY `cdate` (`cdate`),
KEY `country_id_2` (`country_id`,`cdate`),
KEY `country_id_3` (`country_id`,`cdate`,`udid`),
KEY `udid_2` (`udid`,`cdate`),
KEY `cdate_2` (`cdate`,`country_id`),
KEY `udid_3` (`udid`,`country_id`,`cdate`),
KEY `cdate_3` (`cdate`,`udid`),
KEY `cdate_4` (`cdate`,`country_id`,`udid`),
KEY `udid_4` (`udid`,`cdate`,`country_id`),
KEY `cdate_5` (`cdate`,`udid`,`country_id`)
) ENGINE=InnoDB AUTO_INCREMENT=836194 DEFAULT CHARSET=latin1
1 row in set (0.00 sec)

Options: ReplyQuote


Subject
Views
Written By
Posted
Partition using non primary key
3652
April 04, 2012 10:57PM
2173
April 05, 2012 07:57PM


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.