FSM, VISIBILITY MAP AND VACUUM

Update: Heikki’s slides are here!

Heikki Linnakangas gave a presentation this past Sunday at FOSDEM about the improved free space map (FSM), which tracks unused space inside the database, and new visibility map, a bitmap which will indicate which data pages can be skipped during a partial VACUUM. This performance enhancement will affect all users of the upcoming 8.4 software release. You can see what the new FSM implementation looked like back in October fromdepesz’s blog.

Despite Heikki’s modest claim during the talk that the performance tests were inconclusive, the consensus among Postgres contributors is that this feature will result a substantial improvement in the performance of VACUUM for tables that are large, but have few UPDATEs.

The new free space map and Visibility map (in 8.4) and autovacuum (enabled by default starting in version 8.2) are huge administrative usability improvements to version 8 of Postgres. Prior to version 8.1, VACUUM had to be scheduled outside of database system. Autovacuum has been part of the core Postgres distribution for over two years, and is tunable via several global configuration parameters.

The visibility map enables partial VACUUMs — meaning that VACUUM no longer has to examine every tuple to update the FSM. The new FSM implementation eliminates two configuration parameters, effectively automating a formerly manual configuration process.

The new FSM is stored on disk in seperate files inside of $PGDATA/base/, and is cached in shared_buffers. The result is that the max_fsm_* configuration parameters are no longer in 8.4 — Postgres is able to track and adjust this data structure without user intervention.

A few critical features of the new FSM are:

* Now a binary tree structure
* Constructed using 1 byte per heap page
* The top level shows the maximum amount of contiguous space available
* The data structure is auto-repairing and can be reconstructed from the bottom

Previously, every time that VACUUM was run, the free space map had to be reconstructed from scratch. Now, individual nodes in the map may be updated (aka “retail” updates).

Visibility map is a bitmap of heap pages which tracks which tuples on pages are visible to transactions, and therefore not available for VACUUMing.

Previously, when VACUUM ran, it *had* to look at every tuple in a table, because there was no information about which pages may not have been updated since the last VACUUM. With the visibility map, VACUUM will now be able to perform partial scans of table data, skipping pages which are marked as fully visible. Partial scans means fewer I/O operations for VACUUM, and happier database administrators.

注:老文章了,看到了学习一下。

1、以前在执行vacuum时,fsm都会重构,现在则会单独节点的更新(此处应指8.4版本)。

2、之前看到一些max_fsm_*的参数,原来在8.4之后就没有了。

参考:

http://www.chesnok.com/daily/2009/02/10/fsm-visibility-map-and-new-vacuum-awesomeness/

时间: 2024-12-18 12:15:37

FSM, VISIBILITY MAP AND VACUUM的相关文章

PostgreSQL Replication之第二章 理解PostgreSQL的事务日志(1)

在前面的章节中,我们已经理解了各种复制概念.这不仅仅是一个为了接下来将要介绍的东西而增强您的意识的理论概述,还将为您介绍大体的主题. 在本章,我们将更加接近实际的解决方案,并了解PostgreSQL内部是如何工作的,复制意味着什么.我们将看到所谓的事务日志(XLOG)做什么,以及它是如何运作的.XLOG在PostgreSQL复制机制中起着主要作用.理解这部分是如何工作的是必要的. 2.1 PostgreSQL如何写入数据 PostgreSQL的复制完全是关于写入数据的.因此,PostgreSQL

魔兽争霸3 replay 格式

******************************************************************************* * WarCraft III Replay file format description * * * * document version: 1.18 * * document date : 2007-06-26 * * document authors: blue, nagger * * * * For more informtion

Unity FSM 有限状态机

翻译了一下unity wiki上对于有限状态机的案例,等有空时在详细写一下.在场景中添加两个游戏物体,一个为玩家并修改其Tag为Player,另一个为NPC为其添加NPCControl脚本,并为其将玩家角色和路径添加上去.(该案例利用状态机简单的实现了一个NPC的简单AI---巡逻---看到玩家----追逐玩家----丢失玩家----巡逻) 效果: 状态机: 1 using System; 2 using System.Collections; 3 using System.Collection

FSM有限状态机的实现

参考原地址:http://www.manew.com/thread-48266-1-1.html 在查看了这么多状态机的文章后,终于找到个看懂的了,在此很感谢那位作者.果然还是要把代码下载下来慢慢分析才知道. 普通的AI逻辑都很简单,都是switch/case这样的形式,这个形式跟简单工厂模式非常类似,然而我们的工作是把模式改为工厂模式,即把那些case改为单独的状态类. 先从最简单的状态类来说明,先来一个状态抽象基类:FSMState.所有的状态类都继承自这个基类,比如巡逻类.攻击类.作为所有

cocos2d-x 游戏开发之有限状态机(FSM) (四)

cocos2d-x 游戏开发之有限状态机(FSM) (四) 虽然我们了解了FSM,并且可以写自己的FSM,但是有更好的工具帮我们完成这个繁琐的工作.SMC(http://smc.sourceforge.net/)就是这样的工具.下载地址: http://sourceforge.net/projects/smc/files/latest/download 在bin下面的Smc.jar是用于生成状态类的命令行工具.使用如下命令: $ java -jar Smc.jar Monkey.sm 1 真实世

Microsoft Win32 to Microsoft .NET Framework API Map

Microsoft Win32 to Microsoft .NET Framework API Map .NET Development (General) Technical Articles Microsoft .NET Framework and Microsoft Visual Studio User Education TeamsMicrosoft Corporation January 2004 Applies to:    Microsoft® .NET Framework ver

FSM之SMC使用总结

FSM之SMC使用总结 Part1: Smc.jar state machine compiler usage Reference:     http://smc.sourceforge.net/ (Updated February 16, 2015)    Downloads:     http://sourceforge.net/projects/smc/files/ 1) show help: $ java -jar ./Smc.jar -help 2) generate java (c,

13 Free GIS Software Options: Map the World in Open Source

13 Free GIS Software Options: Map the World in Open Source A LIST OF FREE OPEN SOURCE MAPPING SOFTWARE 1025 SHARES FacebookTwitterSubscribe Your search for free GIS software is now over You don't have to pay a king's ransom to map the world. This is

Google Map API V3开发(6) 代码

<html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>Google Maps API V3 Demo</title> <script type="text/javascript" src='http://maps.googleapis.com/maps/api/js?v=3&sensor=tru