pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Update documentation wrt visibility map/index-only scans
4+ messages / 3 participants
[nested] [flat]

* Update documentation wrt visibility map/index-only scans
@ 2012-03-03 00:16 Marti Raudsepp <marti@juffo.org>
  2012-03-16 10:08 ` Re: Update documentation wrt visibility map/index-only scans Marti Raudsepp <marti@juffo.org>
  2012-03-21 18:53 ` Re: Update documentation wrt visibility map/index-only scans Robert Haas <robertmhaas@gmail.com>
  0 siblings, 2 replies; 4+ messages in thread

From: Marti Raudsepp @ 2012-03-03 00:16 UTC (permalink / raw)
  To: pgsql-docs

Hi list,

The documentation needs some updates now that we have index-only
scans. Patch attached. Perhaps the wording can be improved by someone
whose native language is English. But something like this should be
added.

(Not tested, as I couldn't figure out how to build docs on my system)

Regards,
Marti

Attachments:

index-only-docs.patch (text/x-patch, 3.2K) download diff --git a/doc/src/sgml/maintenance.sgml b/doc/src/sgml/maintenance.sgml new file mode 100644 index 03cc6c9..e042293 *** a/doc/src/sgml/maintenance.sgml --- b/doc/src/sgml/maintenance.sgml *************** *** 102,107 **** --- 102,112 ---- </listitem> <listitem> + <simpara>To update the visibility map, which speeds up index-only + scans.</simpara> + </listitem> + + <listitem> <simpara>To protect against loss of very old data due to <firstterm>transaction ID wraparound</>.</simpara> </listitem> *************** *** 329,334 **** --- 334,361 ---- </tip> </sect2> + <sect2 id="vacuum-for-visibility-map"> + <title>Updating Visibility Map</title> + + <para> + Vacuum maintains the table <xref linkend="storage-vm">, which keeps track + of pages that only contain tuples that are visible to all transactions. + This has two purposes. First, vacuum itself can skip such pages on the + next run, since there is nothing to clean up. + </para> + + <para> + Second, index-only scans also take advantage of the visibility map. Since + <productname>PostgreSQL</productname> indexes don't contain tuple + visibility information, a normal index scan fetches the heap tuple for each + matching index entry, to check whether it should be seen by the current + transaction. An index-only scan, on the other hand, checks the + visibility map first. If it's known that all tuples on the page are + visible, the heap fetch can be skipped. This is most noticeable on + large data sets where the visibility map can prevent disk accesses. + </para> + </sect2> + <sect2 id="vacuum-for-wraparound"> <title>Preventing Transaction ID Wraparound Failures</title> diff --git a/doc/src/sgml/storage.sgml b/doc/src/sgml/storage.sgml new file mode 100644 index cb2f60e..a1c300d *** a/doc/src/sgml/storage.sgml --- b/doc/src/sgml/storage.sgml *************** Note that indexes do not have VMs. *** 494,504 **** <para> The visibility map simply stores one bit per heap page. A set bit means that all tuples on the page are known to be visible to all transactions. ! This means that the page does not contain any tuples that need to be vacuumed; ! in future it might also be used to avoid visiting the page for visibility ! checks. The map is conservative in the sense that we ! make sure that whenever a bit is set, we know the condition is true, but if ! a bit is not set, it might or might not be true. </para> </sect1> --- 494,509 ---- <para> The visibility map simply stores one bit per heap page. A set bit means that all tuples on the page are known to be visible to all transactions. ! This information is used by vacuum to skip pages that do not contain any ! tuples that need to be vacuumed and by <fistterm>index-only scans</> to skip ! row visibility checks to the table heap. ! </para> ! ! <para> ! The map is conservative in the sense that we make sure that whenever a bit is ! set, we know the condition is true, but if a bit is not set, it might or ! might not be true. Visibility map bits are only set by vacuum, but are ! cleared by any data-modifying operations on a page. </para> </sect1>
^ permalink raw reply [nested|flat] 4+ messages in thread

* Re: Update documentation wrt visibility map/index-only scans
  2012-03-03 00:16 Update documentation wrt visibility map/index-only scans Marti Raudsepp <marti@juffo.org>
@ 2012-03-16 10:08 ` Marti Raudsepp <marti@juffo.org>
  2012-03-16 14:01   ` Re: Update documentation wrt visibility map/index-only scans Alvaro Herrera <alvherre@commandprompt.com>
  1 sibling, 1 reply; 4+ messages in thread

From: Marti Raudsepp @ 2012-03-16 10:08 UTC (permalink / raw)
  To: pgsql-docs

On Sat, Mar 3, 2012 at 02:16, Marti Raudsepp <marti@juffo.org> wrote:
> The documentation needs some updates now that we have index-only
> scans.

Bump. No response for 2 weeks. Anyone?

Regards,
Marti



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Update documentation wrt visibility map/index-only scans
  2012-03-03 00:16 Update documentation wrt visibility map/index-only scans Marti Raudsepp <marti@juffo.org>
  2012-03-16 10:08 ` Re: Update documentation wrt visibility map/index-only scans Marti Raudsepp <marti@juffo.org>
@ 2012-03-16 14:01   ` Alvaro Herrera <alvherre@commandprompt.com>
  0 siblings, 0 replies; 4+ messages in thread

From: Alvaro Herrera @ 2012-03-16 14:01 UTC (permalink / raw)
  To: Marti Raudsepp <marti@juffo.org>; +Cc: pgsql-docs


Excerpts from Marti Raudsepp's message of vie mar 16 07:08:18 -0300 2012:
> On Sat, Mar 3, 2012 at 02:16, Marti Raudsepp <marti@juffo.org> wrote:
> > The documentation needs some updates now that we have index-only
> > scans.
> 
> Bump. No response for 2 weeks. Anyone?

Add it here:
http://wiki.postgresql.org/wiki/Open_Items

-- 
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Update documentation wrt visibility map/index-only scans
  2012-03-03 00:16 Update documentation wrt visibility map/index-only scans Marti Raudsepp <marti@juffo.org>
@ 2012-03-21 18:53 ` Robert Haas <robertmhaas@gmail.com>
  1 sibling, 0 replies; 4+ messages in thread

From: Robert Haas @ 2012-03-21 18:53 UTC (permalink / raw)
  To: Marti Raudsepp <marti@juffo.org>; +Cc: pgsql-docs

On Fri, Mar 2, 2012 at 7:16 PM, Marti Raudsepp <marti@juffo.org> wrote:
> The documentation needs some updates now that we have index-only
> scans. Patch attached. Perhaps the wording can be improved by someone
> whose native language is English. But something like this should be
> added.
>
> (Not tested, as I couldn't figure out how to build docs on my system)

Committed after some editing and markup repair.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2012-03-21 18:53 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2012-03-03 00:16 Update documentation wrt visibility map/index-only scans Marti Raudsepp <marti@juffo.org>
2012-03-16 10:08 ` Marti Raudsepp <marti@juffo.org>
2012-03-16 14:01   ` Alvaro Herrera <alvherre@commandprompt.com>
2012-03-21 18:53 ` Robert Haas <robertmhaas@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox