PostgreSQL 10.0 preview 性能提升 - radix tree提升字符编码转换性能

less than 1 minute read


PostgreSQL 10.0 使用radix tree提升UTF-8与其他字符编码转换的性能。

编码map文件按新的radix tree编排,性能相比binary search好了很多。

Use radix tree for character encoding conversions.  
author	Heikki Linnakangas <>	  
Mon, 13 Mar 2017 18:46:39 +0000 (20:46 +0200)  
committer	Heikki Linnakangas <>	  
Mon, 13 Mar 2017 18:46:39 +0000 (20:46 +0200)  
Replace the mapping tables used to convert between UTF-8 and other  
character encodings with new radix tree-based maps. Looking up an entry in  
a radix tree is much faster than a binary search in the old maps. As a  
bonus, the radix tree representation is also more compact, making the  
binaries slightly smaller.  
The "combined" maps work the same as before, with binary search. They are  
much smaller than the main tables, so it doesn't matter so much. However,  
the "combined" maps are now stored in the same .map files as the main  
tables. This seems more clear, since they're always used together, and  
generated from the same source files.  
Patch by Kyotaro Horiguchi, with lot of hacking by me at various stages.  
Reviewed by Michael Paquier and Daniel Gustafsson.  




Flag Counter

digoal’s 大量PostgreSQL文章入口