Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

PostgreSQL source code interpretation (71)-query statement # 56 (make_one_rel function # 21 muri.

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

< 0) { /* not cached yet */ estimate_hash_bucket_stats(root, get_rightop(restrictinfo->

Clause), virtualbuckets, & restrictinfo- > right_mcvfreq, & restrictinfo- > right_bucketsize); thisbucketsize = restrictinfo- > right_bucketsize } thismcvfreq = restrictinfo- > right_mcvfreq;} else {Assert (bms_is_subset (restrictinfo- > left_relids, inner_path- > parent- > relids); / * lefthand side is inner * / thisbucketsize = restrictinfo- > left_bucketsize If (thisbucketsize

< 0) { /* not cached yet */ estimate_hash_bucket_stats(root, get_leftop(restrictinfo->

< 0)(gdb) 3357 estimate_hash_bucket_stats(root,(gdb) 3358 get_rightop(restrictinfo->

Clause), (gdb) 3357 estimate_hash_bucket_stats (root, (gdb) 3362 thisbucketsize = restrictinfo- > right_bucketsize (gdb) p * restrictinfo$17 = {type = T_RestrictInfo, clause = 0x1b87260, is_pushed_down = true, outerjoin_delayed = false, can_join = true, pseudoconstant = false, leakproof = false, security_level = 0, clause_relids = 0x1b87380, required_relids = 0x1b86c68, outer_relids = 0x0, nullable_relids = 0x0, left_relids = 0x1b87340, right_relids = 0x1b87360, orclause = 0x0, parent_ec = 0x1b85b88, eval_cost = {startup = 0, per_tuple = 0.00250000000000001}, per_tuple = 0.0001 Outer_selec =-1, mergeopfamilies = 0x1b873c8, left_ec = 0x1b85b88, right_ec = 0x1b85b88, left_em = 0x1b85d58, right_em = 0x1b85c80, scansel_cache = 0x1b92e50, outer_is_left = true, hashjoinoperator = 98, left_bucketsize =-1, right_bucketsize = 0.00010013016921998598, left_mcvfreq =-1, right_mcvfreq = 0}

The calculation process is similar to the previous introduction, calculating the cost of the expression, etc., you can debug.

The final calculation result

3505} (gdb) p * path$19 = {jpath = {path = {type = T_HashPath, pathtype = T_HashJoin, parent = 0x1b91d30, pathtarget = 0x1b91f68, param_info = 0x0, parallel_aware = false, parallel_safe = true, parallel_workers = 0, rows = 100000, startup_cost = 3465, total_cost = 5386, pathkeys = 0x0}, jointype = JOIN_INNER, inner_unique = false, outerjoinpath = 0x1b866c0, innerjoinpath = 0x1b8e780, joinrestrictinfo = 0x1b92208}, path_hashclauses = 0x1b93200, 0x1b93200 = 2 Inner_rows_total = 100000}

DONE!

IV. Reference materials

Allpaths.c

Cost.h

Costsize.c

PG Document:Query Planning

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report