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

回到上一级页面: 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. 搭建企业级NFS网络文件共享服务[二]

    1.1.8 NFS问题总结 1.问:使用showmount -e 127.0.0.1后报clnt_create: RPC: Program not registered错误 答:顺序不对,重启nfs服 ...

  2. 阿里云CentOS 7服务器挂载数据盘

    本次使用的是centOS 7.4 64位操作系统 第一步:查看磁盘情况 我们发现,我总共有三个磁盘,分别为/dev/vda(100G)./dev/vdb(200G)./dev/vdc(100G),而被 ...

  3. November 30th 2016 Week 49th Wednesday

    Your attitude, not your aptitude, will determine your altitude. 决定你人生高度的,不是你的才能,而是你的态度. Basically, I ...

  4. Git学习文档——文件状态git status

    1.已经跟踪的文件有三种状态 已跟踪的文件,即被纳入版本控制的文件,又分为未修改(unmodified).已修改(modified).已暂存(staged)三种状态. 如图: 当在工作目录中新加入一个 ...

  5. CSS控制图片和文字在同一行显示且对齐的3种方法

    CSS控制图片和文字在同一行显示且对齐的3种方法 在 HTML 代码中,有时会需要在文字旁边加上一个图标. 默认情况,是图片置顶对齐,文字置底对齐,所以通常图片高,文字低,不能水平居中对齐. 常见方法 ...

  6. 在jupyter notebook中运行R语言

    要想在jupyter notebook中运行R语言其实非常简单,按顺序安装下面扩展包即可: install.package('repr','IRdisplay','evaluate','crayon' ...

  7. uva 12508 - Triangles in the Grid(几何+计数)

    版权声明:本文为博主原创文章.未经博主同意不得转载. https://blog.csdn.net/u011328934/article/details/35244875 题目链接:uva 12508 ...

  8. 整合Yolov3到游戏引擎

    这篇其实是前文 CUDA版Grabcut的实现 的后续,和上文一样,先放视频. (博客园好像不支持视频,gif文件太大,视频链接) 在上文用CUDA实现opencv下的grabcut后,当时问题主要是 ...

  9. haproxy 启动错误

    在haproxy启动时会报错 ALERT] / () : Starting proxy short_message: cannot bind socket 问题1,如果bind的是vip,则需要内核添 ...

  10. ThinkPHP5 核心类 Request 远程代码漏洞分析

    ThinkPHP5 核心类 Request 远程代码漏洞分析 先说下xdebug+phpstorm审计环境搭建: php.ini添加如下配置,在phpinfo页面验证是否添加成功. [XDebug] ...