磨砺技术珠矶,践行数据之道,追求卓越价值
回到上一级页面: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索引页 
磨砺技术珠矶,践行数据之道,追求卓越价值

PostgreSQL参数学习:random_page_cost的更多相关文章

  1. PostgreSQL参数学习:deadlock_timeout

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

  2. PostgreSQL参数学习:max_wal_senders

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

  3. PostgreSQL参数学习:wal_keep_segments

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

  4. PostgreSQL参数学习:vacuum_defer_clean_age

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

  5. [转帖]PostgreSQL 参数调整(性能优化)

    PostgreSQL 参数调整(性能优化) https://www.cnblogs.com/VicLiu/p/11854730.html 知道一个 shared_pool 文章写的挺好的 还没仔细看 ...

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

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

  7. PostgreSQL的 synchronous_standby_names 参数学习

    磨砺技术珠矶,践行数据之道,追求卓越价值回到上一级页面: PostgreSQL集群方案相关索引页     回到顶级页面:PostgreSQL索引页[作者 高健@博客园  luckyjackgao@gm ...

  8. PostgreSQL 参数调整(性能优化)

    昨天分别在外网和无外网环境下安装PostgreSQL,有外网环境下安装的相当顺利.但是在无外网环境下就是两个不同的概念了,可谓十有八折.感兴趣的同学可以搭建一下. PostgreSQL安装完成后第一件 ...

  9. 开始我的PostgreSQL的学习之旅

    经过这么长时间的学习,终于确定了我的研究方向是PostgreSQL的空间数据库的设计流程,具体怎样实现这个过程,其难度是挺大的,我必须克服掉,尽量得往前看.大家有相同的研究方向的,可以一同来学习,相互 ...

随机推荐

  1. linux(ubuntu)因为代理网页无法访问

    当有一天你打开浏览器的时候,页面上显示,未链接到网络,请检查代理服务器,出现了如下图所示的情况: 但是你检查一下了网络,可以ping通,而且在同一个网络下,你的手机平板可以上网,那么你就想一想,昨天i ...

  2. WEB测试—兼容测试

    现在的操作系统,浏览器越来越多样性,导致软件兼容性测试在目前软件测试领域占有很重要的地位,我在测试项目经历中,以浏览器的兼容测试为主,平台.分辨率为辅. (我的经验前提:我测试过3类的不同行业的web ...

  3. Spring(十三)之SQL存储过程

    SimpleJdbcCall 类可以被用于调用一个包含 IN 和 OUT 参数的存储过程.你可以在处理任何一个 RDBMS 时使用这个方法,就像 Apache Derby, DB2, MySQL, M ...

  4. Git创建本地分支并关联远程分支

    创建本地分支git branch 分支名 例如:git branch dev,这条命令是基于当前分支创建的本地分支,假设当前分支是master(远程分支),则是基于master分支创建的本地分支dev ...

  5. javascript中获取dom元素高度和宽度

    javascript中获取dom元素高度和宽度的方法如下: 网页可见区域宽: document.body.clientWidth网页可见区域高: document.body.clientHeight网 ...

  6. HDU Virtual Friends(超级经典的带权并查集)

    Virtual Friends Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)T ...

  7. Reading SketchVisor Robust Network Measurement for Sofeware Packet Processing

    SIGCOMM17 摘要 在现有的网络测量任务中包括流量监测.数据收集和一系列网络攻击的预防.现有的基于sketch的测量算法存在严重性能损失.大量计算开销以及测量的精确性不足,而基于硬件的优化方法并 ...

  8. HDU 3695 Computer Virus on Planet Pandora (AC自己主动机)

    题意:有n种病毒序列(字符串),一个模式串,问这个字符串包括几种病毒. 包括相反的病毒也算.字符串中[qx]表示有q个x字符.具体见案列. 0 < q <= 5,000,000尽然不会超, ...

  9. useradd添加用户

    sudo useradd -m -s /bin/bash $user sudo passwd $user linux useradd/userdel 命令 转自:http://hi.baidu.com ...

  10. Java中 方法的多态 简析图

    代码如下: public class Client{    public static void main(String[] args){        Person p = new Person() ...