当前位置:网站首页>Tikv & tiflash accelerates complex business queries
Tikv & tiflash accelerates complex business queries
2022-07-18 03:35:00 【InfoQ】
One 、TiKV Bank deposit And TiFlash Column storage mixed use

1.1 Mixing principle
1.2 Mix optimization

Two 、 Advanced filtering of labeling system

2.1 Read from TiKV
SELECT
/*+ READ_FROM_STORAGE(tikv[b], tikv[c],tikv[d]) */
a.*,
b.CUST_NAME,b.CERT_TYPE,b.CERT_NUM,b.CUST_TYPE,b.SEX,b.AGE,b.BIRTH_DT,
c.ORG_ID,c.ORG_NAME,
d.ASSET,d.ASSET_MON_AVG
FROM
(
SELECT /*+ READ_FROM_STORAGE(tikv[m],tikv[n]) */
m.cust_id
FROM
m_cust_label m
RIGHT JOIN m_cust_org n ON m.CUST_ID = n.CUST_ID
WHERE
m.cat1 IN ( 516, 710, 230,3301 )
AND n.ORG_ID IN ( '133','8716', '7162') ORDER BY n.cust_id ASC LIMIT 100
) a
LEFT JOIN m_cust_main b ON a.cust_id = b.cust_id
LEFT JOIN m_cust_org c ON a.cust_id = c.cust_id
LEFT JOIN m_cust_data d ON a.cust_id = d.cust_id ;
2.2 Read From TiKV & TiFlash
SELECT
/*+ READ_FROM_STORAGE(tikv[b], tikv[c],tikv[d]) */
a.*,
b.CUST_NAME,b.CERT_TYPE,b.CERT_NUM,b.CUST_TYPE,b.SEX,b.AGE,b.BIRTH_DT,
c.ORG_ID,c.ORG_NAME,
d.ASSET,d.ASSET_MON_AVG
FROM
(
SELECT /*+ READ_FROM_STORAGE(tiflash[m],tikv[n]) */
m.cust_id
FROM
m_cust_label m
RIGHT JOIN m_cust_org n ON m.CUST_ID = n.CUST_ID
WHERE
m.cat1 IN ( 516, 710, 230,3301 )
AND n.ORG_ID IN ( '133','8716', '7162') ORDER BY n.cust_id ASC LIMIT 100
) a
LEFT JOIN m_cust_main b ON a.cust_id = b.cust_id
LEFT JOIN m_cust_org c ON a.cust_id = c.cust_id
LEFT JOIN m_cust_data d ON a.cust_id = d.cust_id
2.3 TiFlash & MPP

set @@session.tidb_allow_mpp=1;
set @@session.tidb_enforce_mpp=1;
SELECT
/*+ READ_FROM_STORAGE(tikv[b], tikv[c],tikv[d]) */
a.*,
b.CUST_NAME,b.CERT_TYPE,b.CERT_NUM,b.CUST_TYPE,b.SEX,b.AGE,b.BIRTH_DT,
c.ORG_ID,c.ORG_NAME,
d.ASSET,d.ASSET_MON_AVG
FROM
(
SELECT /*+ READ_FROM_STORAGE(tiflash[m],tiflash[n]) */
m.cust_id
FROM
m_cust_label m
RIGHT JOIN m_cust_org n ON m.CUST_ID = n.CUST_ID
WHERE
m.cat1 IN ( 516, 710, 230,3301 )
AND n.ORG_ID IN ( '133','8716', '7162') ORDER BY n.cust_id ASC LIMIT 100
) a
LEFT JOIN m_cust_main b ON a.cust_id = b.cust_id
LEFT JOIN m_cust_org c ON a.cust_id = c.cust_id
LEFT JOIN m_cust_data d ON a.cust_id = d.cust_id
2.4 SPM Fixed execution plan
CREATE GLOBAL|SESSION BINDING for <BindableStmt > USING <BindableStmt2>
SHOW GLOBAL|SESSION BINDINGS ; -- View the binding plan explain format = 'verbose' <BindableStmt2>;
show warnings; -- Through execution show warnings Understand the SQL Which statement is used binding

3、 ... and 、 Ranking of value institutions under the label
3.1 According to the selected attribute ( Multivalued )

3.2 Implementation plan



Four 、 summary
边栏推荐
- Tencent celebrities share | Tencent alluxio (DOP) landing and Optimization Practice in the financial scene
- 中国人力资源数字化生态图谱-灵活用工市场
- Infrared remote control atmosphere lamp touch chip-dlt8sa15a-jericho
- TiKV & TiFlash 加速复杂业务查询
- Slow SQL analysis and optimization
- Issue 105: a failed browser plug-in development
- Musk suspends twitter acquisition, with a breakup fee of $1billion
- Issue 100: encapsulate the flitter component of short answer
- 二叉树上的相等子树
- 网站漏洞修复服务商讲解越权漏洞的原因
猜你喜欢

Will the expired data of redis be deleted immediately? Great mystery

mysql(三)路由器、MHA高可用

go-zero微服务实战系列(五、缓存代码怎么写)

win11虚拟机里面mysql的ibd文件在哪里

Slow SQL analysis and optimization

Zhihu Gaozan: Data Center -- Alibaba, Daas

Realizing deep learning framework from zero -- glove

MySQL (III) router, MHA high availability

Infrared remote control atmosphere lamp touch chip-dlt8sa15a-jericho

Robotframework advanced (III) integrated Jenkins operation automation use case
随机推荐
想成为精英级开发者?请逼自己养成这10个习惯
慢 SQL 分析与优化
The world's first commercial cryptographic chip against quantum attack | Muchuang
网站漏洞修复服务商讲解越权漏洞的原因
Award winning research | openeuler developer experience research questionnaire
Flutter 中的 offstage
Evaluation of 5 internal systems to build a low code platform
曾经,我对着AI客服喷了两分钟,它只回复了我的第一句话
Data transmission: Practice of batch extraction of isomorphic and heterogeneous IP data sources
ModuleNotFoundError: No module named ‘fake_ useragent‘
Tencent Dajia Sharing | Tencent alloxio (DOP) in Financial scene Landing and optimization practice
二叉树上的相等子树
leetcode:558. 四叉树交集【四叉树dfs】
Sony's metauniverse layout
Efficient development of harmonyos course applications based on ETS
什么是主动元数据?为什么Gartner预测它是元数据管理的新方向
WebView loading URL prompt net:: error_ UNKNOWN_ URL_ SCHEME
DEVKIT-mpc5744p配置rtos
第106期:HREE.JS的应用场景和基本概念
Analyze the meaning of "collaboration" in collaborative office, and how can digital office easily "solve the problem"?