作者
digoal
日期
2021-08-03
标签
PostgreSQL , 分区 , 裁剪
https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=475dbd0b718de8ac44da144f934651b959e3b705
记录未裁剪列表, 降低plan time.
Track a Bitmapset of non-pruned partitions in RelOptInfo author David Rowley <drowley@postgresql.org> Mon, 2 Aug 2021 23:47:24 +0000 (11:47 +1200) committer David Rowley <drowley@postgresql.org> Mon, 2 Aug 2021 23:47:24 +0000 (11:47 +1200) commit 475dbd0b718de8ac44da144f934651b959e3b705 tree df2a34ed2a93b6be5f603e9b5c789762a1d42a7e tree parent a5cb4f9829fbfd68655543d2d371a18a8eb43b84 commit | diff Track a Bitmapset of non-pruned partitions in RelOptInfo For partitioned tables with large numbers of partitions where queries are able to prune all but a very small number of partitions, the time spent in the planner looping over RelOptInfo.part_rels checking for non-NULL RelOptInfos could become a large portion of the overall planning time. Here we add a Bitmapset that records the non-pruned partitions. This allows us to more efficiently skip the pruned partitions by looping over the Bitmapset. This will cause a very slight slow down in cases where no or not many partitions could be pruned, however, those cases are already slow to plan anyway and the overhead of looping over the Bitmapset would be unmeasurable when compared with the other tasks such as path creation for a large number of partitions. Reviewed-by: Amit Langote, Zhihong Yu Discussion: https://postgr.es/m/CAApHDvqnPx6JnUuPwaf5ao38zczrAb9mxt9gj4U1EKFfd4AqLA@mail.gmail.com
复制
PostgreSQL 许愿链接
您的愿望将传达给PG kernel hacker、数据库厂商等, 帮助提高数据库产品质量和功能, 说不定下一个PG版本就有您提出的功能点. 针对非常好的提议,奖励限量版PG文化衫、纪念品、贴纸、PG热门书籍等,奖品丰富,快来许愿。开不开森.
9.9元购买3个月阿里云RDS PostgreSQL实例
PostgreSQL 解决方案集合
德哥 / digoal's github - 公益是一辈子的事.
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。