PostgreSQL11preview-優化器增強彙總
標籤
PostgreSQL , 優化器 , 增強 , 11
背景
PostgreSQL 11 優化器增強。
E.1.3.1.4. Optimizer
-
Improve the selection of the optimizer statistics` most-common-values (Jeff Janes, Dean Rasheed)
高頻詞的選擇性計算更好。
postgres=# d pg_stats View "pg_catalog.pg_stats" Column | Type | Collation | Nullable | Default ------------------------+----------+-----------+----------+--------- schemaname | name | | | tablename | name | | | attname | name | | | inherited | boolean | | | null_frac | real | | | avg_width | integer | | | n_distinct | real | | | most_common_vals | anyarray | | | most_common_freqs | real[] | | | histogram_bounds | anyarray | | | correlation | real | | | most_common_elems | anyarray | | | most_common_elem_freqs | real[] | | | elem_count_histogram | real[] | | |
Previously most-common-values (MCV) were chosen based on their significance compared to all column values. Now, MCV are chosen based on their significance compared to the non-MCV values. This improves the statistics for uniform (fewer) and non-uniform (more) distributions.
-
Improve selectivity estimates for >= and <= when the constants are not common values (Tom Lane)
Previously such cases used the same selectivity as > and <, respectively. This change is particularly useful for BETWEEN with small ranges.
大於等於、小於等於某常量時,如果這個常量是一個非高頻詞(不在most_common_vals中),使用更優的選擇演算法。
-
Optimize var = var to var IS NOT NULL where equivalent (Tom Lane)
重寫var=var這樣的表示式,改成var is not null,從而提高選擇性評估的準確性。
This leads to better selectivity estimates.
PostgreSQL 11:
postgres=# explain select * from aaa where id=id and info=`abc`; QUERY PLAN ----------------------------------------------------------- Seq Scan on aaa (cost=0.00..379776.80 rows=16 width=368) Filter: ((id IS NOT NULL) AND (info = `abc`::text)) (2 rows)
PostgreSQL 10:
postgres=# explain select * from aaa where id=id and info=`abc`; QUERY PLAN ------------------------------------------------------------------------- Seq Scan on aaa (cost=10000000000.00..10000990476.50 rows=1 width=368) Filter: ((id = id) AND (info = `abc`::text)) (2 rows)
-
Improve row count optimizer estimates for EXISTS and NOT EXISTS queries (Tom Lane)
增強exists, not exists的行數評估。
-
Add optimizer selectivity costs for HAVING clauses (Tom Lane)
增加having子句的選擇性(返回多少行)成本估算(以前不對這部分進行估算)。
相關文章
- PostgreSQL11preview-索引增強彙總SQLView索引
- PostgreSQL11preview-分割槽表增強彙總SQLView
- PostgreSQL11preview-平行計算增強彙總SQLView
- 機器學習中常見優化方法彙總機器學習優化
- 【OC梳理】效能檢測及優化彙總優化
- PostgreSQL10.0preview效能增強-hash,nestloopjoin優化(聰明的優化器是這樣的)SQLViewOOP優化
- ANDROID記憶體優化(大彙總——上)Android記憶體優化
- ANDROID記憶體優化(大彙總——中)Android記憶體優化
- ANDROID記憶體優化(大彙總——下)Android記憶體優化
- MySQL慢日誌功能分析及優化增強MySql優化
- 優化產業佈局 增強發展後勁TMN優化產業
- JavaScript 前端效能優化小竅門例項彙總JavaScript前端優化
- [譯] Android效能優化:APK瘦身方式大彙總Android優化APK
- VS2013執行速度優化彙總優化
- Mysql 52條SQL語句效能優化策略彙總MySql優化
- CrossApp V1.1.5 全新推出 優化和增強功能ROSAPP優化
- Mysql關於自增主鍵,自增主鍵優化總結MySql優化
- 前端模組化彙總前端
- PostgreSQL11preview-索引優化。filter智慧消除、分割槽索引智慧合併SQLView索引優化Filter
- MySQL 52個SQL效能優化策略SQL語句彙總MySql優化
- css優先順序彙總CSS
- AngularJS 優秀文章彙總AngularJS
- 前端開發優化的一些常見方法彙總前端優化
- 每隔15行生成一個彙總行(王工優化版)優化
- 影像增強演算法總結演算法
- java9第5篇-Collection集合類的增強與優化Java優化
- 從Java垃圾回收機制窺探記憶體優化(增強版)Java記憶體優化
- AAAI 2020 | 52篇深度強化學習accept論文彙總AI強化學習
- SQL Server 最佳化彙總SQLServer
- CSS瀏覽器相容彙總CSS瀏覽器
- ByteHouse MaterializedMySQL 增強最佳化ZedMySql
- 9個Java效能優化工具彙總Java優化
- 新的深度學習優化器Ranger:RAdam + LookAhead強強結合深度學習優化Ranger
- 【強化學習】強化學習/增強學習/再勵學習介紹強化學習
- MIT打造模組化機器人 幫助增強人類力量MIT機器人
- TotalFinder 1.13.1 macOS優秀的Finder增強工具Mac
- ORACLE優化器RBO與CBO介紹總結Oracle優化
- Java9系列第7篇:Java.util.Optional優化與增強Java優化