为了更快的定位您的问题,请提供以下信息,谢谢
【详述】问题详细描述
【背景】做过哪些操作
下面3个查询的结果都不一样,看profile是查到了不同的副本上
mysql> select count(1) from dwd_report_order where company_id=90136113084612608 and store_id=‘110399702994764288’ group by store_id;
±---------+
| count(1) |
±---------+
| 48339 |
±---------+
1 row in set (0.01 sec)
mysql> select count(1) from dwd_report_order where company_id=90136113084612608 and store_id=‘110399702994764288’ group by store_id;
±---------+
| count(1) |
±---------+
| 7984 |
±---------+
1 row in set (0.00 sec)
mysql> select count(1) from dwd_report_order where company_id=90136113084612608 and store_id=‘110399702994764288’ group by store_id;
±---------+
| count(1) |
±---------+
| 5701 |
±---------+
1 row in set (0.01 sec)
explain 的sql:
mysql> explain select count(1) from dwd_report_order where company_id=90136113084612608 and store_id=‘110399702994764288’ group by store_id;
±---------------------------------------------------------------------------------------+
| Explain String |
±---------------------------------------------------------------------------------------+
| PLAN FRAGMENT 0 |
| OUTPUT EXPRS:77: count |
| colocate exec groups: ExecGroup{groupId=0, nodeIds=[0, 1, 2, 3]} |
| PARTITION: RANDOM |
| |
| RESULT SINK |
| |
| 3:Project |
| | <slot 77> : 77: count |
| | |
| 2:AGGREGATE (update finalize) |
| | output: count(1) |
| | group by: 2: store_id |
| | |
| 1:Project |
| | <slot 2> : 2: store_id |
| | |
| 0:OlapScanNode |
| TABLE: dwd_report_order |
| PREAGGREGATION: ON |
| PREDICATES: 1: company_id = 90136113084612608, 2: store_id = ‘110399702994764288’ |
| partitions=1/1 |
| rollup: dwd_report_order |
| tabletRatio=1/1024 |
| tabletList=6605521 |
| cardinality=8 |
| avgRowSize=26.0 |
±---------------------------------------------------------------------------------------+
看tablet 的副本都是normal状态
mysql> SHOW PROC ‘/dbs/10184/6051984/partitions/6051983/6603920/6605521’;
±----------±----------±--------±------------±------------------±----------------------±-----------------±---------------------±--------------------±-----------±----------±---------±-------±------±--------------±-------------±---------------------±--------------------------------------------------±---------------------------------------------------------------------------------------±-------------+
| ReplicaId | BackendId | Version | VersionHash | LstSuccessVersion | LstSuccessVersionHash | LstFailedVersion | LstFailedVersionHash | LstFailedTime | SchemaHash | DataSize | RowCount | State | IsBad | IsSetBadForce | VersionCount | PathHash | MetaUrl | CompactionStatus | IsErrorState |
±----------±----------±--------±------------±------------------±----------------------±-----------------±---------------------±--------------------±-----------±----------±---------±-------±------±--------------±-------------±---------------------±--------------------------------------------------±---------------------------------------------------------------------------------------±-------------+
| 6605522 | 6464006 | 513784 | 0 | 513784 | 0 | -1 | 0 | NULL | 1696497272 | 192565196 | 2500887 | NORMAL | false | false | 356 | -5863101841537184957 | http://xxx:8040/api/meta/header/6605521 | http://xxx:8040/api/compaction/show?tablet_id=6605521&schema_hash=1696497272 | false |
| 6605523 | 6356131 | 513784 | 0 | 513784 | 0 | -1 | 0 | NULL | 1696497272 | 187173914 | 2500887 | NORMAL | false | false | 44 | 1720694507208494185 | http://xxx:8040/api/meta/header/6605521 | http://xxx:8040/api/compaction/show?tablet_id=6605521&schema_hash=1696497272 | false |
| 6605524 | 6526711 | 513780 | 0 | 513780 | 0 | 513784 | 0 | 2024-12-18 11:52:39 | 1696497272 | 212628022 | 2500887 | NORMAL | false | false | 91 | 3116429720073172711 | http://xxx:8040/api/meta/header/6605521 | http://xxx:8040/api/compaction/show?tablet_id=6605521&schema_hash=1696497272 | false |
±----------±----------±--------±------------±------------------±----------------------±-----------------±---------------------±--------------------±-----------±----------±---------±-------±------±--------------±-------------±---------------------±--------------------------------------------------±---------------------------------------------------------------------------------------±-------------+
【业务影响】查询数据异常
【是否存算分离】否
【StarRocks版本】例如:3.3.5
【集群规模】例如:3fe(3 follower)+7be
【机器信息】CPU虚拟核/内存/网卡,例如:48C/64G/万兆
【联系方式】社区群3-杨荣
【附件】
cnt_profile_1.txt (20.5 KB) cnt_profile_3.txt (20.4 KB) cnt_profile_2.txt (20.4 KB)
查询dump的文件
cnt_dump_file (17.6 KB)
show create table 查看表结构
show_create_table (5.7 KB)