MySQL Forums
Forum List  »  NDB clusters

composite column for primary key in cluster
Posted by: jongse park
Date: February 11, 2015 12:14AM

Hi,

Are composite primary keys efficient in mysql cluster?

This is script:
--------------------
CREATE TABLE `Table1` (
`CONTS_ID` varchar(20) NOT NULL,
`ASSET_ID` varchar(20) NOT NULL,
`EFCT_START_DT` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`EFCT_END_DT` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`INSRT_USER_ID` varchar(10) DEFAULT NULL,
`INSRT_DT` timestamp NULL DEFAULT NULL,
`UPDT_USER_ID` varchar(10) DEFAULT NULL,
`UPDT_DT` timestamp NULL DEFAULT NULL,
`ASSET_TYPE_CD` varchar(2) NOT NULL,
PRIMARY KEY (`CONTS_ID`,`ASSET_ID`,`EFCT_START_DT`,`EFCT_END_DT`)
) ENGINE=NDBCLUSTER DEFAULT CHARSET=utf8;
-----------------------

I just changed storeage from innodb to ndbcluster.
Some queries can't use the primary key for join tables and explain result is full scan .

Are composite primary keys good for mysql cluster?

Options: ReplyQuote


Subject
Views
Written By
Posted
composite column for primary key in cluster
2177
February 11, 2015 12:14AM


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.