基本上,我有一个大约7亿多行的桌子,并不断更新每天约200千-300克的浏览量,每个月末,我将冲淡3个多月的数据。
CREATE TABLE TESTRECORD (
TIMEADDED timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
SERIAL varchar(8) NOT NULL,
ENDTIME varchar(14) NOT NULL,
MODEL varchar(2) NOT NULL,
PROCESS int(4) NOT NULL,
PF varchar(4) NOT NULL,
COMID varchar(6) NOT NULL,
COMTP varchar(3) NOT NULL,
TRIAL varchar(4) NOT NULL,
TEST varchar(8) NOT NULL,
SECTION int(2) NOT NULL,
DATA_0 float NOT NULL,
DATA_1 float NOT NULL,
DATA_2 float NOT NULL,
DATA_3 float NOT NULL,
DATA_4 float NOT NULL,
DATA_5 float NOT NULL,
PRIMARY KEY (SN,ENDTIME,SECTION),
UNIQUE KEY BASESN (SN,ENDTIME,MODEL,PROCESS,PF,COMID,TRIAL,TEST,SECTION),
KEY COMID (COMID),
KEY TRIAL (TRIAL),
KEY PF (PF),
KEY TEST (TEST)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
The unique key defined the parameters that will be used in the select statement. Since the basic function for this table is for dynamic data analyzing, so there is no specific orders what will occurs in the where clause and how many of them will be used, and there could be some random group by by one or two of the cols from the unique key as well. So it is pretty much impossible to index all the possible combo to ensure fast operation on any giving select.
我的理解是,根据在图象中列明的顺序,我的舱面使用指数,就我而言,如果我在选择发言中使用SN、ENDTIME和PF,那么,只有头2列将使用独特的钥匙。 是否有有效的方法可以将指数按每栏或单项技术细分为1个指数,以加速比值或至少实现条款中不同栏目的总体平等业绩?
thank!