现在有ods_yallagame__t_account_full表,1.5亿条数据,主键模型(为了频繁的实时更新)建表语句如下:
CREATE TABLE ods_yallagame__t_account_full
(
fid
bigint(20) NOT NULL ,
fname
varchar(65533) NULL ,
fnationalityid
bigint(20) NULL ,
fheaderurl
varchar(65533) NULL,
fstatus
bigint(20) NULL,
flanguage
bigint(20) NULL,
fage
bigint(20) NULL,
fsex
bigint(20) NULL,
fbirthday
varchar(65533) NULL,
fexperience
bigint(20) NULL,
fcurrency
bigint(20) NULL,
fdiamond
bigint(20) NULL,
flevelid
bigint(20) NULL,
fskinid
bigint(20) NULL,
fvipid
bigint(20) NULL,
fregistersource
bigint(20) NULL,
fregisterip
varchar(65533) NULL,
fregistertime
datetime NULL,
fdevice
varchar(65533) NULL,
fdevicetype
bigint(20) NULL,
fdownloadchannelid
bigint(20),
fisdeleted
tinyint(4) NULL,
fmodifytime
datetime NULL,
fisused
tinyint(4) NULL,
faccounttype
bigint(20) NULL,
fvipvalue
bigint(20) NULL,
fisrecharged
tinyint(4) NULL,
fpushtoken
varchar(65533) NULL,
fprettyid
bigint(20) NULL,
fdeletestatus
bigint(20) NULL,
fnationname
varchar(65533) NULL
) ENGINE=OLAP
PRIMARY KEY(fid
)
COMMENT “OLAP”
DISTRIBUTED BY HASH(fid
) BUCKETS 12
PROPERTIES (
“replication_num” = “3”,
“in_memory” = “false”,
“storage_format” = “DEFAULT”
);
目前是3fe,3be,分开部署,starrcosk版本为StarRocks-2.0.1。be单节点查询内存8g上限,be机器皆为8核64g
现执行sql语句:SELECT fid,fprettyid,fname,fstatus,fcurrency,fdiamond,fregistertime FROM ods_ludo.ods_yallagame__t_account_full order by fid desc limit 0,30
需要耗费20s左右,据DBA反馈,在mysql也只需100ms即可出结果。