Hi team — I have a question about the SHOW DATA co...
# questions-and-troubleshooting
g
Hi team — I have a question about the SHOW DATA command. I’m running a cluster with 3 FEs and 3 CNs (version
3.5.4-1ce07c8
). The cluster uses CEPH as built-in storage, and local storage is enabled as a cache. When I create table XXX with the default properties
replication_num = 1
and
datacache.enable = true,
the
SHOW DATA
output indicates the table has 16 replicas. Is this a bug in
SHOW DATA
, or does the table actually have 16 replicas? If it’s the latter, how can I ensure there is only a single replica for the table itself (excluding any data cache replicas)? Thanks! create table command
Copy code
CREATE TABLE `XXX` (
  `id` int(11) NOT NULL COMMENT "",
  ...
  `__op_ts` datetime NULL COMMENT "",
  `__is_del` boolean NULL COMMENT ""
) ENGINE=OLAP 
PRIMARY KEY(`id`)
COMMENT "XXX"
DISTRIBUTED BY HASH(`id`)
ORDER BY(`__op_ts`, `__is_del`)
PROPERTIES (
"compression" = "LZ4",
"datacache.enable" = "true",
"enable_async_write_back" = "false",
"enable_persistent_index" = "true",
"persistent_index_type" = "CLOUD_NATIVE",
"replication_num" = "1",
"storage_volume" = "builtin_storage_volume"
);
Output of
show data from XXX
Copy code
TableName,IndexName,Size,ReplicaCount,RowCount
"XXX","XXX","5.638 KB","16","2"
"","Total","5.638 KB","16",""
Output of
show partition XXX
Copy code
PartitionId,PartitionName,CompactVersion,VisibleVersion,NextVersion,State,PartitionKey,Range,DistributionKey,Buckets,DataSize,StorageSize,RowCount,EnableDataCache,AsyncWrite,AvgCS,P50CS,MaxCS,DataVersion,VersionEpoch,VersionTxnType
"4019310","XXX","0","3","4","NORMAL","","","id","16","5.6KB","5.6KB","2","true","false","0.00","0.00","0.00","3","377123239545012224","TXN_NORMAL"
k
the replica concept inherited from shared nothing cluster, for a single tablet, the replica number means how many copies for the same data. for a partition or table or db, the replica numbers will be just a sumup of all replicas of all the tablets in the given object (partition/table/db). in shared data, there is always one replica for a tablet. as for your case, it is really 16 tablets with each tablet has one replica, so the total number is 16
g
Thank you @Kevin Cai 😄 Quick further question, if I were to reduce tablet count with the same partition expression, should I specify bucket number in distributed by statement?