PG/GP排序中的abbreviated key

阅读: 评论:0

PG/GP排序中的abbreviated key

PG/GP排序中的abbreviated key

PG/GP排序私有状态结构Tuplesortstate中有一个成员SortSupport sortKeys;而sortKeys中有这么几个成员abbreviate、abbrev***:

"abbreviate" concerns whether or not the abbreviated key optimization is applicable in principle。也就是说可以使用此进行一个缩写key优化。那么这个优化是什么呢?

这个是9.6引入的新特性,看下它的patch介绍:

Add sort support routine for the UUID data type. This introduces a simple encoding scheme to produce abbreviated keys: pack as many bytes of each UUID as will fit into a Datum.  On little-endian machines, a byteswap is also performed; the abbreviated comparator can therefore just consist of a simple 3-way unsigned integer comparison.The purpose of this change is to speed up sorting data on a column of type UUID.

Make abbreviated key comparisons for text a bit cheaper.If we do some byte-swapping while abbreviating, we can do comparisons using integer arithmetic rather than memcmp.

也就是对uuid,bytea,char(n)的排序性能增强,使用abb keys, 整型比较算法取代memcmp。

Patch地址:

/?p=postgresql.git;a=commit;h=a76ef15d9fc9207a0758e8d6f6700dc8c931a934

/?p=postgresql.git;a=commit;h=bfb54ff15a447fb22e9deae096e0d45b3e4bd56f

本文发布于:2024-01-27 17:01:42,感谢您对本站的认可!

本文链接:https://www.4u4v.net/it/17063461021526.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:GP   PG   key   abbreviated
留言与评论(共有 0 条评论)
   
验证码:

Copyright ©2019-2022 Comsenz Inc.Powered by ©

网站地图1 网站地图2 网站地图3 网站地图4 网站地图5 网站地图6 网站地图7 网站地图8 网站地图9 网站地图10 网站地图11 网站地图12 网站地图13 网站地图14 网站地图15 网站地图16 网站地图17 网站地图18 网站地图19 网站地图20 网站地图21 网站地图22/a> 网站地图23