PosgreSQL 9.0 High Performance中文版瑕疵
磨砺技术珠矶,践行数据之道,追求卓越价值
回到上一级页面: 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中文版瑕疵的更多相关文章
- 教你把UltraEdit如何注册激活教程及UltraEdit 22.0.0.48 官方中文版下载
UltraEdit 22.0.0.48 官方中文版下载:链接: http://pan.baidu.com/s/1i3f7mZV 密码: r23v2015-5-30号更新 第一.关闭网络连接(或者直接拔 ...
- 实时流式计算框架Storm 0.9.0发布通知(中文版)
Storm0.9.0发布通知中文翻译版(2013/12/10 by 富士通邵贤军 有错误一定告诉我 shaoxianjun@hotmail.com^_^) 我们很高兴宣布Storm 0.9.0已经成功 ...
- Hive2.0函数大全(中文版)
摘要 Hive内部提供了很多函数给开发者使用,包括数学函数,类型转换函数,条件函数,字符函数,聚合函数,表生成函数等等,这些函数都统称为内置函数. 目录 数学函数 集合函数 类型转换函数 日期函数 条 ...
- Spark 2.2.0 文档中文版 Quick Start
原地址:http://spark.apache.org/docs/latest/quick-start.html 这篇指导对使用Spark提供了一个快速的介绍.我们首先介绍API,通过spark交互式 ...
- JSON-RPC 2.0规范 翻译 中文版
JSON-RPC 2.0规范 起源日期: 2010-03-26(基于2009-05-24的版本号) 修正: 2013-01-04 作者: JSON-RPC 工作组 <json-rpc@googl ...
- hive Hive 2.0函数大全(中文版)(转)
转自:https://www.cnblogs.com/MOBIN/p/5618747.html#1 摘要 Hive内部提供了很多函数给开发者使用,包括数学函数,类型转换函数,条件函数,字符函数,聚合函 ...
- Embarcadero Delphi 7 Lite 7.0.4.453 中文版
https://www.7down.com/soft/116014.html 软件介绍 Embarcadero Delphi 7精简版 是Windows平台下著名的快速应用程序开发工具(Rapid A ...
- Capture One 21 Pro 14.0.2.36中文版安装教程
Capture One 21 Pro 14.0.2.36 for windows是一款由丹麦PHASE ONE飞思公司推出的.非常专业强大的图像处理编辑工具. 下载 Capture One 21 Pr ...
- Embarcadero Delphi 7 Enterprise 7.0.4.453 中文版
在 win7下可能报错请大家按下面的方式 delphi7运行不正常的提示unable to rename'c:\program files\Borland\delphi7\Bin\delphi32.$ ...
随机推荐
- JQuery-学习。
jQuery是一套跨浏览器的JavaScript库,简化HTML与JavaScript之间的操作.由约翰·雷西格(John Resig)在2006年1月的BarCamp NYC上发布第一个版本.目前是 ...
- node-sass 解决 no such file or directory
在使用node-sass编译的时候出现以下情况 Error: ENOENT: no such file or directory, scandir 'D:\xxxx\node_modules\.npm ...
- 用CAShapeLayer写股市K线图动画效果
用CAShapeLayer写股市K线图动画效果 说明 入市有风险,炒股需谨慎.(因项目需求,本人提供了写这种效果的源码) 效果 源码 // // ViewController.m // Path // ...
- Linux 系统的/var目录
/var目录主要针对常态性变动的文件,包括缓存(cache).登录档(log file)以及某些软件运作所产生的文件 /var目录下的重要目录 目录 应放置文件内容 /var/cache/ 应用程序本 ...
- IntelliJ IDEA 13.0.2 快捷设置
1.IDEA修改快捷键. 首先打开 File ->Settings -> KeyMap 然后点击 copy 然后就可以自己修改了. 2.全文搜索 位置:Edit-Find-Find ...
- November 21st 2016 Week 48th Monday
A bird is known by its note, and a man by his talk. 闻其声而知鸟,听其言而知人. Listen to what a man talks, watch ...
- ZT C语言链表操作(新增单向链表的逆序建立)
这个不好懂,不如看 转贴:C语言链表基本操作http://www.cnblogs.com/jeanschen/p/3542668.html ZT 链表逆序http://www.cnblogs.com/ ...
- VRSProcess(二)
1._beginthreadex再谈 Windows操作系统提供了这样的一种解决方案——每个线程都将拥有自己专用的一块内存区域来供标准C运行库中所有有需要的函数使用.而且这块内存区域的创建就是由C/C ...
- 关于layui(layer)子页面获取不到父页面jQuery对象的问题。
如果在使用layui-layer模块过程中,在子页面执行代码: window.parent.$("#id").val() 报错:window.parent.$ is not a f ...
- css-table属性运用
最近在工作中遇到了一些不常用的布局,很多使用 CSS table 属性,并结合 ::before,::after 伪元素完成了,使得 HTML 的结构相对更简单,更具有语义性.当 HTML 结构越清晰 ...