磨砺技术珠矶,践行数据之道,追求卓越价值

回到上一级页面: PostgreSQL杂记页     回到顶级页面:PostgreSQL索引页

发表此文不是为了吐槽,而是为了防止更多的受害者出现啊,拿到书后,我就知道,上当了。

让我们对比一下googble book上的原书和此中文版:
http://books.google.com/books?id=OWOAu0GcsqoC&pg=PT310&lpg=PT310&dq=index+bloat+Postgresql&source=bl&ots=Ury_jKQGBo&sig=9hGwS4OmXWxjuynlagw6OoRyoHw&hl=en&sa=X&ei=E-INUt3bMoakyQHqzYFA&ved=0CEQQ6AEwBDgU#v=onepage&q&f=true

Measuing index bloat:

Assuming you have a version of PostgreSQL before 9.0,
where VACUUM FULL will bloat indexes, you can easily get
this table into the situation where its data pages can be
cleaned up but not its indexs. Just sparsely deleting some of
the rows in the table, so that no index pages can be
reclaimed, then issue VACUUM FULL: DELETE FROM pgbench_accounts
WHERE aid % 2 = 0;
VACUUM FULL; The table will be named just "accounts"on PostgreSQL versions before
8.4. Now running the index ratio query shows a very different propotion: relname | accounts_pkey
index_ration | 0.27
index_size | 43 MB
table_size | 155 MB Now the idex is 27% of the size of the table--clearly quite bloated compared with the
original, compact representation. While the exact threshold where the ratio is so far
off that an index is obviously bloated varies depending on the structure of the table
and its index, if you take a periodic snapshot of this data it's possible to see if
bloat growth is increasing or not.

看看本书中是怎么翻的,就先说这第一段吧:

原文是:

Assuming you have a version of PostgreSQL before 9.0,where VACUUM FULL will bloat indexes, you can easily get this table into the situation where its data pages can be cleaned up but not its indexs. Just sparsely deleting some ofthe rows in the table, so that no index pages can be reclaimed, then issue VACUUM FULL:

DELETE FROM pgbench_accounts
WHERE aid % 2 = 0;
VACUUM FULL;

书中的翻译是:

假设用户所使用的PostgreSQL版本是9.0以前的版本,这些版本中的VACUUM FULL操作会引起索引膨胀,所创建的表可以很容易清理数据页面而不是清理其索引。该操作只是删除表中的某些行,所以没有索引页面可以进行回收,这就是VACUUM FULl引起的问题

如果是我,会翻译成:

假定你有一个9.0版之前的PostgreSQL,那么在此版本中VACUUM FULL会导致索引膨胀:你可以很容易地创造这样一种场景:表的数据页被清除,但索引页却没有得到清除----如果你稀疏地删除表的一些行(因此也保留一些行),这样一来就没有相应的索引页可以被回收;然后你再运行 
VACUUM FULL来 看看: DELETE FROM pgbench_accounts WHERE aid % 2 = 0;
VACUUM FULL;

再看第二段:

The table will be named just "accounts"on PostgreSQL versions before
8.4. Now running the index ratio query shows a very different propotion: relname | accounts_pkey
index_ration | 0.27
index_size | 43 MB
table_size | 155 MB Now the idex is 27% of the size of the table--clearly quite bloated compared with the
original, compact representation. While the exact threshold where the ratio is so far
off
that an index is obviously bloated varies depending on the structure of the table
and its index, if you take a periodic snapshot of this data it's possible to see if
bloat growth is increasing or not.

书中翻的是:

在PostgreSQL8.4之前的版本中,该表的名称为 "accounts"。现在运行索引比例查询得到的结果会有不同的比例。
relname | accounts_pkey
index_ration | 0.27
index_size | 43 MB
table_size | 155 MB
现在索引的大小紧凑地表示为表的27%。显然相比于原始的大小它膨胀得很厉害。而实际上比例阀值一直关闭,索引膨胀很大程度上与表和索引的结构有关,如果用户执行数据的定期快照,可以看到膨胀是否增长。

如果是我来翻,我会翻译成:

(顺便提一句)在PostgreS8.4版以前,上述的表名称为普通的"accounts"。现在运行前述的索引比率查询会显示一个非常不同的比例值:

relname | accounts_pkey
index_ration | 0.27
index_size | 43 MB
table_size | 155 MB 现在索引的大小是表大小的27%--很明显与原来的相对紧凑的索引相比发生了膨胀。不过,表明一个索引已经明显膨胀的具体的比例阀值会随着表及其索引的结构而变动,如果你定期建立此类数据的快照,你就有可能看出来膨胀是否明显增长。

当真是精品太难得。

回到上一级页面: PostgreSQL杂记页     回到顶级页面:PostgreSQL索引页

磨砺技术珠矶,践行数据之道,追求卓越价值

PosgreSQL 9.0 High Performance中文版瑕疵的更多相关文章

  1. 教你把UltraEdit如何注册激活教程及UltraEdit 22.0.0.48 官方中文版下载

    UltraEdit 22.0.0.48 官方中文版下载:链接: http://pan.baidu.com/s/1i3f7mZV 密码: r23v2015-5-30号更新 第一.关闭网络连接(或者直接拔 ...

  2. 实时流式计算框架Storm 0.9.0发布通知(中文版)

    Storm0.9.0发布通知中文翻译版(2013/12/10 by 富士通邵贤军 有错误一定告诉我 shaoxianjun@hotmail.com^_^) 我们很高兴宣布Storm 0.9.0已经成功 ...

  3. Hive2.0函数大全(中文版)

    摘要 Hive内部提供了很多函数给开发者使用,包括数学函数,类型转换函数,条件函数,字符函数,聚合函数,表生成函数等等,这些函数都统称为内置函数. 目录 数学函数 集合函数 类型转换函数 日期函数 条 ...

  4. Spark 2.2.0 文档中文版 Quick Start

    原地址:http://spark.apache.org/docs/latest/quick-start.html 这篇指导对使用Spark提供了一个快速的介绍.我们首先介绍API,通过spark交互式 ...

  5. JSON-RPC 2.0规范 翻译 中文版

    JSON-RPC 2.0规范 起源日期: 2010-03-26(基于2009-05-24的版本号) 修正: 2013-01-04 作者: JSON-RPC 工作组 <json-rpc@googl ...

  6. hive Hive 2.0函数大全(中文版)(转)

    转自:https://www.cnblogs.com/MOBIN/p/5618747.html#1 摘要 Hive内部提供了很多函数给开发者使用,包括数学函数,类型转换函数,条件函数,字符函数,聚合函 ...

  7. Embarcadero Delphi 7 Lite 7.0.4.453 中文版

    https://www.7down.com/soft/116014.html 软件介绍 Embarcadero Delphi 7精简版 是Windows平台下著名的快速应用程序开发工具(Rapid A ...

  8. Capture One 21 Pro 14.0.2.36中文版安装教程

    Capture One 21 Pro 14.0.2.36 for windows是一款由丹麦PHASE ONE飞思公司推出的.非常专业强大的图像处理编辑工具. 下载 Capture One 21 Pr ...

  9. Embarcadero Delphi 7 Enterprise 7.0.4.453 中文版

    在 win7下可能报错请大家按下面的方式 delphi7运行不正常的提示unable to rename'c:\program files\Borland\delphi7\Bin\delphi32.$ ...

随机推荐

  1. beautifulsoup之CSS选择器

    BeautifulSoup支持大部分的CSS选择器,其语法为:向tag或soup对象的.select()方法中传入字符串参数,选择的结果以列表形式返回. tag.select("string ...

  2. js过滤HTML标签以及&nbsp;

    function removeHTMLTag(str) { str = str.replace(/<\/?[^>]*>/g,''); //去除HTML tag str = str.r ...

  3. MySQL慢日志简介及Anemometer工具介绍

    作者:王航威 - fordba.com 来源:http://fordba.com/box-anemometer-visual-mysql-slow.html,叶师傅对原文内容略有调整 备注:王航威是知 ...

  4. django新建项目,连接mysql数据库

    安装django,进入Django目录,运行 python setup.py install 在workplace目录下新建一个名为site01的项目: cd workplacedjango-admi ...

  5. [原创]获取JS数组最大值、最小值

    核心关键 JS有Array数组对象,使用prototype内置属性扩展,增加Array数组max().min()方法 具体代码 //最小值 Array.prototype.min = function ...

  6. 铁乐学python_Day38_多进程和multiprocess模块1

    铁乐学python_Day38_多进程和multiprocess模块1 [进程] 运行中的程序就是一个进程. 所有的进程都是通过它的父进程来创建的. 因此,运行起来的python程序也是一个进程,那么 ...

  7. 【Excel】单元格的下拉框是怎么做的?

    如果我们希望将产品这一列的每个单元格都能选择 左侧的产品就好了,就像这样 这里使用的是"验证数据有效性"功能 在这里: 点击F,选择F列后,打开“数据验证”,如图,选择序列,选择来 ...

  8. NTRIP协议学习(一)

    这篇博客讲得很清晰.  https://blog.csdn.net/sinat_19447667/article/details/67637167 可以参考的文献包括:<多系统GNSS实时数据质 ...

  9. 学习博客之Java继承多态接口

    这一篇博客主要是对软工前一阶段学习的总结,主要是对Java的学习总结,包括三部分:Java的继承.多态和接口 Java的继承 继承是面向对象的三大特性之一,能够实现软件的复用. Java子类继承父类的 ...

  10. [转载并收藏]JavaScript 疲劳终极指南:我们行业的真相

    这篇文章说的深得我心,特别是前半段. 特此收藏. 中文译文:http://www.zcfy.cc/article/the-ultimate-guide-to-javascript-fatigue-re ...