PostgreSQL 10.0 preview 性能提升 - radix tree提升字符編碼轉換性能
標簽
PostgreSQL , 10.0 , radix tree , 字符編碼轉換
背景
PostgreSQL 10.0 使用radix tree提升UTF-8與其他字符編碼轉換的性能。
編碼map文件按新的radix tree編排,性能相比binary search好了很多。
Use radix tree for character encoding conversions.
author Heikki Linnakangas <heikki.linnakangas@iki.fi>
Mon, 13 Mar 2017 18:46:39 +0000 (20:46 +0200)
committer Heikki Linnakangas <heikki.linnakangas@iki.fi>
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.
Discussion: https://www.postgresql.org/message-id/20170306.171609.204324917.horiguchi.kyotaro%40lab.ntt.co.jp
這個patch的討論,詳見郵件組,本文末尾URL。
PostgreSQL社區的作風非常嚴謹,一個patch可能在郵件組中討論幾個月甚至幾年,根據大家的意見反複的修正,patch合並到master已經非常成熟,所以PostgreSQL的穩定性也是遠近聞名的。
參考
最後更新:2017-04-21 00:30:37