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梳理】效能檢測及優化彙總優化
- VS2013執行速度優化彙總優化
- [譯] Android效能優化:APK瘦身方式大彙總Android優化APK
- JavaScript 前端效能優化小竅門例項彙總JavaScript前端優化
- Mysql 52條SQL語句效能優化策略彙總MySql優化
- MySQL慢日誌功能分析及優化增強MySql優化
- MySQL 52個SQL效能優化策略SQL語句彙總MySql優化
- PostgreSQL11preview-索引優化。filter智慧消除、分割槽索引智慧合併SQLView索引優化Filter
- AAAI 2020 | 52篇深度強化學習accept論文彙總AI強化學習
- Mysql關於自增主鍵,自增主鍵優化總結MySql優化
- 優化產業佈局 增強發展後勁TMN優化產業
- 前端開發優化的一些常見方法彙總前端優化
- 前端模組化彙總前端
- 新的深度學習優化器Ranger:RAdam + LookAhead強強結合深度學習優化Ranger
- java9第5篇-Collection集合類的增強與優化Java優化
- 影像增強演算法總結演算法
- ByteHouse MaterializedMySQL 增強最佳化ZedMySql
- Java9系列第7篇:Java.util.Optional優化與增強Java優化
- Vagrant box 命令彙總彙總
- 雲原生閘道器~文章彙總
- 機器學習演算法優缺點對比及選擇(彙總篇)機器學習演算法
- APP優化總結APP優化
- webpack優化總結Web優化
- TotalFinder 1.13.1 macOS優秀的Finder增強工具Mac
- mysql資料庫最佳化彙總MySql資料庫
- 如何增強grpc的攔截器RPC
- 前端效能優化總結前端優化
- 斜率優化DP總結優化
- SYBASE優化總結(zt)優化
- React 效能優化總結React優化
- iOS 效能優化總結iOS優化
- React效能優化總結React優化
- canvas效能優化總結Canvas優化
- Serilog文件翻譯系列(六) - 可用的接收器、增強器、格式化輸出