磨砺技术珠矶,践行数据之道,追求卓越价值
回到上一级页面:PostgreSQL基础知识与基本操作索引页    回到顶级页面:PostgreSQL索引页
[作者 高健@博客园  luckyjackgao@gmail.com]

参考官方文档:

http://www.postgresql.org/docs/9.2/static/runtime-config-query.html

如下的各个参数,都是只有相对意义,比较的基准是:seq_page_cost=1

Unfortunately, there is no well-defined method for determining ideal values for the cost variables. They are best treated as averages over the entire mix of queries that a particular installation will receive. This means that changing them on the basis of just a few experiments is very risky.

基本上,如果系统Cache使用状况良好,那么,random_page_cost可以适当降低。

而如果Cache使用达到接近于内存数据库的程度,那么seq_page_cost和 random_page_cost还可相对于cpu开头的个参数再降低。

反之亦然。

The cost variables described in this section are measured on an arbitrary scale. Only their relative values matter, hence scaling them all up or down by the same factor will result in no change in the planner's choices. By default, these cost variables are based on the cost of sequential page fetches; that is, seq_page_cost is conventionally set to 1.0 and the other cost variables are set with reference to that. But you can use a different scale if you prefer, such as actual execution times in milliseconds on a particular machine.Note: Unfortunately, there is no well-defined method for determining ideal values for the cost variables. They are best treated as averages over the entire mix of queries that a particular installation will receive. This means that changing them on the basis of just a few experiments is very risky.
seq_page_cost (floating point)
Sets the planner's estimate of the cost of a disk page fetch that is part of a series of sequential fetches. The default is 1.0. This value can be overridden for tables and indexes in a particular tablespace by setting the tablespace parameter of the same name (see ALTER TABLESPACE).random_page_cost (floating point)
Sets the planner's estimate of the cost of a non-sequentially-fetched disk page. The default is 4.0. This value can be overridden for tables and indexes in a particular tablespace by setting the tablespace parameter of the same name (see ALTER TABLESPACE).Reducing this value relative to seq_page_cost will cause the system to prefer index scans; raising it will make index scans look relatively more expensive. You can raise or lower both values together to change the importance of disk I/O costs relative to CPU costs, which are described by the following parameters.Random access to mechanical disk storage is normally much more expensive than four-times sequential access. However, a lower default is used (4.0) because the majority of random accesses to disk, such as indexed reads, are assumed to be in cache. The default value can be thought of as modeling random access as 40 times slower than sequential, while expecting 90% of random reads to be cached.If you believe a 90% cache rate is an incorrect assumption for your workload, you can increase random_page_cost to better reflect the true cost of random storage reads. Correspondingly, if your data is likely to be completely in cache, such as when the database is smaller than the total server memory, decreasing random_page_cost can be appropriate. Storage that has a low random read cost relative to sequential, e.g. solid-state drives, might also be better modeled with a lower value for random_page_cost.Tip: Although the system will let you set random_page_cost to less than seq_page_cost, it is not physically sensible to do so. However, setting them equal makes sense if the database is entirely cached in RAM, since in that case there is no penalty for touching pages out of sequence. Also, in a heavily-cached database you should lower both values relative to the CPU parameters, since the cost of fetching a page already in RAM is much smaller than it would normally be.
cpu_tuple_cost (floating point)
Sets the planner's estimate of the cost of processing each row during a query. The default is 0.01.cpu_index_tuple_cost (floating point)
Sets the planner's estimate of the cost of processing each index entry during an index scan. The default is 0.005.cpu_operator_cost (floating point)
Sets the planner's estimate of the cost of processing each operator or function executed during a query. The default is 0.0025.

[作者 高健@博客园  luckyjackgao@gmail.com] 
回到上一级页面: PostgreSQL基础知识与基本操作索引页     回到顶级页面:PostgreSQL索引页 
磨砺技术珠矶,践行数据之道,追求卓越价值

转载于:https://www.cnblogs.com/gaojian/p/3350321.html

PostgreSQL参数学习:random_page_cost相关推荐

  1. PostgreSQL参数学习:vacuum_defer_clean_age

    官方文档: http://www.postgresql.org/docs/9.3/static/runtime-config-replication.html 为了防止slave端读取数据时,因为读到 ...

  2. PostgreSQL参数学习:wal_keep_segments

    http://www.postgresql.org/docs/9.3/static/runtime-config-replication.html 参考官方文档: wal_keep_segments ...

  3. FALCON组装参数学习

    FALCON组装参数学习 (2017-06-27 13:15:32) 转载▼   分类: 三代 ############################################ pa_DBsp ...

  4. [云炬python3玩转机器学习笔记] 2-4批量学习、咋西安学习、参数学习和非参数学习

    机器学习的其他分类: 在线学习(online learining)和批量学习(离线学习 batch learning/offline learning): 批量学习(之前没有具体说明的话,都可以用批量 ...

  5. [转]Python3之max key参数学习记录

    Python3之max key参数学习记录 转自https://www.cnblogs.com/zhangwei22/p/9892422.html 今天用Python写脚本,想要实现这样的功能:对于给 ...

  6. 【机器学习】隐马尔可夫模型及其三个基本问题(三)模型参数学习算法及python实现

    [机器学习]隐马尔可夫模型及其三个基本问题(三)模型参数学习算法及python实现 一.一些概率与期望值的计算 二.非监督学习方法(Baum-Welch算法) 三.python实现 隐马尔可夫模型参数 ...

  7. 常见的五种神经网络(4)-深度信念网络(下)篇之深度信念网络的原理解读、参数学习

    该系列的其他文章: 常见的五种神经网络(1)-前馈神经网络 常见的五种神经网络(2)-卷积神经网络 常见的五种神经网络(3)-循环神经网络(上篇) 常见的五种神经网络(3)-循环神经网络(中篇) 常见 ...

  8. 【论文精读】时序逻辑推理之反向传播参数学习 Backpropagation for Parametric STL

    前言:借这里汇报一下毕业论文的进度,结构学习部分的论文和代码已经完成98%,现在回头搞参数学习发现现在掌握的方法都不能很好地契合毕设的整体结构.因此现在飞速地多看几篇,争取本周完工. 主要参考文献: ...

  9. 贝叶斯网专题11:参数学习之极大似然估计

    第一部分:贝叶斯网基础 1.1 信息论基础 1.2 贝叶斯网基本概念 1.3 变量独立性的图论分析 第二部分:贝叶斯网推理 2.1 概率推理中的变量消元方法 2.2 团树传播算法 2.3 近似推理 2 ...

  10. 贝叶斯网专题12:参数学习之贝叶斯估计

    第一部分:贝叶斯网基础 1.1 信息论基础 1.2 贝叶斯网基本概念 1.3 变量独立性的图论分析 第二部分:贝叶斯网推理 2.1 概率推理中的变量消元方法 2.2 团树传播算法 2.3 近似推理 2 ...

最新文章

  1. 可算是有文章,把Linux零拷贝讲透彻了!
  2. opencv 创建图像_非艺术家的图像创建(OpenCV项目演练)
  3. 计算机系统基础:文件管理相关知识笔记
  4. 谈谈Java虚拟机——Class文件结构
  5. 95-910-150-源码-FlinkSQL-Flink SQL 的元数据管理
  6. mongodb创建数据库用户名和密码_Linux运维老司机,教你MongoDB 的不同连接方式
  7. mongodb入门基本语法
  8. 【原】数据分析/数据挖掘/机器学习---- 必读书目
  9. PR缩放转场 视频缩放特效转场过渡效果PR预设
  10. error: binding reference of type int to const int discards qualifiers
  11. android停止蓝牙音乐服务,蓝牙音乐播放状态一直为暂停态
  12. mat1 and mat2 shapes cannot be multiplied (128x432 and 576x64)的解决
  13. 【Python学习记录】Numpy广播机制(broadcast)
  14. one 主格 复数 宾格_主格和宾格的复数形式到底怎么写请说出答案
  15. 实用经验 92 区分函数模版与模版函数,类模版和模板类
  16. HTML文字动画,缓慢浮入
  17. Niushop 商品海报
  18. 网上看到的window8下载
  19. 联想笔记本-野兽模式设置
  20. 客快物流大数据项目(八十一): Kudu原理

热门文章

  1. C中得到4号错误(中断),怎么办
  2. 又接触到自己以前建立的计算系统,有点震惊
  3. 邮箱是互联网的个人中心
  4. RGB数据剪切后保存为JPG格式文件的代码(使用jpeglib)
  5. 我喜欢这个地方,是因为和你一起走过
  6. Trie字典树数组实现
  7. C# 启动EXE 关闭EXE ProcessStartInfo
  8. JAVA关键字final修饰类,Java入门之认识final关键字、权限修饰符和内部类
  9. php5.5 下载安装,【图片】PHP5.2、5.3、5.4、5.5、5.6的php memcache dll扩展下载和安装【洄溪吧】_百度贴吧...
  10. 关于mysql性能优化_关键的十个MySQL性能优化技巧