当前位置:网站首页>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)
- The 10th China Cloud Computing Conference · China Station: looking forward to the trend of science and technology in the next decade
- 金仓KFS数据双向同步场景部署
- CVPR 2022 | Dalian Institute of technology proposes a self calibration lighting framework for low light level image enhancement of real scenes
- 使用BENCHMARKSQL工具对KingbaseES预热数据时执行:select sys_prewarm(‘NDX_OORDER_2 ‘)报错
- Nat. Comm. | 使用Tensor-cell2cell对细胞通讯进行环境感知去卷积
- [set theory] set concept and relationship (set represents | number set | set relationship | contains | equality | set relationship property)
- [brush questions] connected with rainwater (one dimension)
- JS realizes lazy loading of pictures
- 540. Single element in ordered array
猜你喜欢
![[brush questions] connected with rainwater (one dimension)](/img/21/318fcb444b17be887562f4a9c1fac2.png)
[brush questions] connected with rainwater (one dimension)

vulnhub HA: Natraj

Joint search set: the number of points in connected blocks (the number of points in a set)
![[brush questions] most elements (super water king problem)](/img/79/13a715b74bc18a4a62113de76a65f6.png)
[brush questions] most elements (super water king problem)

Which Bluetooth headset is cost-effective? Four Bluetooth headsets with high cost performance are recommended

vulnhub HA: Natraj

js实现在可视区内,文字图片动画效果

540. Single element in ordered array

Fcpx template: sweet memory electronic photo album photo display animation beautiful memory

Supervised pre training! Another exploration of text generation!
随机推荐
使用BENCHMARKSQL工具对KingbaseES预热数据时执行:select sys_prewarm(‘NDX_OORDER_2 ‘)报错
[文献阅读] Sparsity in Deep Learning: Pruning and growth for efficient inference and training in NN
怎么用Kotlin去提高生产力:Kotlin Tips
How to retrieve the password for opening word files
深潜Kotlin协程(二十):构建 Flow
Some information about the developer environment in Chengdu
解决bp中文乱码
Js/ts bottom implementation double click event
Solve BP Chinese garbled code
CVPR 2022 | Dalian Technology propose un cadre d'éclairage auto - étalonné pour l'amélioration de l'image de faible luminosité de la scène réelle
Data Lake three swordsmen -- comparative analysis of delta, Hudi and iceberg
Application of I2C protocol of STM32F103 (read and write EEPROM)
Dismantle a 100000 yuan BYD "Yuan". Come and see what components are in it.
Redis persistence principle
Xrandr modifier la résolution et le taux de rafraîchissement
Bugku CTF daily question baby_ flag. txt
redis 持久化原理
[mathematical logic] predicate logic (toe normal form | toe normal form conversion method | basic equivalence of predicate logic | name changing rules | predicate logic reasoning law)
Practical operation of vim
[set theory] set concept and relationship (set represents | number set | set relationship | contains | equality | set relationship property)