当前位置:网站首页>Kingbasees plug-in KDB of Jincang database_ exists_ expand
Kingbasees plug-in KDB of Jincang database_ exists_ expand
2022-07-03 04:22:00 【Thousands of sails passed by the side of the sunken boat_】
1. The plugin is introduced
kdb_exists_expand Plug ins are used to optimize EXISTS Sub Links , Generate more efficient execution plans .
For the existence of EXISTS Sub connected SQL sentence , If meet :
EXISTS Child link is SELECT Query statement of type
EXISTS Sub links are OR Conditions , Such as :
SELECT * from a WHERE EXISTS (SELECT 1 from e cond1 OR cond2);
Among them cond1 The query condition of is related to the table queried in the sub link ,cond2 The query condition of is independent of the table queried in the sub link , Such as :
SELECT * from a WHERE EXISTS (SELECT 1 from e WHERE e.id =1 OR a.name = null);
among cond1 by e.id =1, With tables in child links e relevant
among cond2 by a.name = null, With tables in child links e Unrelated
Then the plug-in will EXISTS Improve and optimize the unrelated conditions of sub links , Can improve SQL Query execution efficiency .
2. Add plug-ins
In the use of kdb_exists_expand Before , You need to add it to kingbase.conf Of documents shared_preload_libraries in , And restart the database .
shared_preload_libraries = 'kdb_exists_expand' # (change requires restart)
3. Parameter configuration
kdb_exists_expand.enable
exists Sub link optimization switch ,boolean Type data , On by default .
4. Example
After starting this function , It was supposed to be a Semi join Implementation plan of , It has been changed into two parallel sub plans SubPlan 2 and SubPlan 3 To execute , and SubPlan3 It's the one that comes up Exists Sub Links .
# explain (costs false) select p.parameter_value from sheet_parameter p join dep_b001 e on exists ( select 1 from dep_b001 e where e.dep_id in ('b8703c00fb4973aaa1723f95475dfa') and p.parameter_value like e.tree_level_code || '%' or p.parameter_value is null); QUERY PLAN ----------------------------------------------------------------------- Limit -> Result -> Sort Sort Key: b.sheet_no, d.ordinal -> Hash Left Join Hash Cond: (c.sheet_id = p.sheet_id) Filter: ((SubPlan 2) OR (SubPlan 3)) -> Nested Loop Left Join Join Filter: (d.design_id = b.id) -> Nested Loop Join Filter: (d.id = c.sheet_id) -> Seq Scan on sheet d -> Materialize -> Seq Scan on sheet_sheet_category c Filter: (category_id = '\x7a3ca091e24459a4f8c23eb10197f7'::bytea) -> Seq Scan on sheet_design b -> Hash -> Seq Scan on sheet_parameter p SubPlan 2 -> Seq Scan on dep_b001 e Filter: (((dep_id)::text = 'b8703c00fb4973aaa1723f95475dfa'::text) AND ((p.parameter_value)::text ~~ ((tree_level_code)::text || '%'::text))) SubPlan 3 -> Result One-Time Filter: (p.parameter_value IS NULL) -> Seq Scan on dep_b001 e_1 SubPlan 1 -> Aggregate -> Seq Scan on sheet_data a Filter: ((sheet_id = d.id) AND (status = '0'::numeric)) (29 rows)
5. Uninstall plugins
modify kingbase.conf In file shared_preload_libraries
Restart the database after parameters .
shared_preload_libraries = ''
边栏推荐
- Social phobia of contemporary young people (II)
- FFMpeg example
- [no title] 2022 chlorination process examination content and free chlorination process examination questions
- 以两列的瀑布流为例,我们应该怎么构建每一列的数组
- Export of zip file
- Feature_selection
- Introduction of pointer variables in function parameters
- 金仓数据库KingbaseES 插件kdb_date_function
- 金仓数据库KingbaseES 插件kdb_database_link
- 树莓派如何连接WiFi
猜你喜欢
[graduation season · aggressive technology Er] Confessions of workers
How to retrieve the password for opening word files
竞品分析撰写
Introduction of pointer variables in function parameters
[文献阅读] Sparsity in Deep Learning: Pruning and growth for efficient inference and training in NN
300+篇文献!一文详解基于Transformer的多模态学习最新进展
Joint search set: the number of points in connected blocks (the number of points in a set)
Two points -leetcode-540 A single element in an ordered array
Deep dive kotlin synergy (19): flow overview
金仓KFS数据双向同步场景部署
随机推荐
300+ documents! This article explains the latest progress of multimodal learning based on transformer
How to process the current cell with a custom formula in conditional format- How to address the current cell in conditional format custom formula?
Mila、渥太华大学 | 用SE(3)不变去噪距离匹配进行分子几何预训练
xrandr修改分辨率與刷新率
Interface in TS
540. Single element in ordered array
2022-02-12 (338. Bit count)
Design and implementation of kubelet garbage collection mechanism to protect nodes from being preempted by containers image GC high threshold
sd卡数据损坏怎么回事,sd卡数据损坏怎么恢复
MySQL field userid comma separated save by userid query
Know that Chuangyu cloud monitoring - scanv Max update: Ecology OA unauthorized server request forgery and other two vulnerabilities can be detected
X-ray normal based contour rendering
[文献阅读] Sparsity in Deep Learning: Pruning and growth for efficient inference and training in NN
ZIP文件的导出
跨境电商多商户系统怎么选
金仓数据库KingbaseES 插件kdb_exists_expand
Redraw and reflow
C language series - Section 3 - functions
Classes in TS
Esp32 series (3): GPIO learning (take simple GPIO input and output, ADC, DAC as examples)