pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rod Taylor <rbt@rbt.ca>
To: Dave E Martin XXIII <postgresql-to.dave@dave.to>
Cc: pgsql-bugs@postgresql.org
Subject: Re: Index speeds up one row table (why)?
Date: 31 May 2003 22:29:33 -0400
Message-ID: <1054434573.11968.42.camel@jester> (raw)
In-Reply-To: <3ED93338.80806@dave.to>
References: <3ED93338.80806@dave.to>

> vacuum verbose bigint_unique_ids;
> INFO:  --Relation public.bigint_unique_ids--
> INFO:  Index bigint_unique_ids__table_name: Pages 29; Tuples 1: Deleted 
> 5354.
>     CPU 0.01s/0.04u sec elapsed 0.05 sec.
> INFO:  Removed 11348 tuples in 79 pages.
>     CPU 0.00s/0.02u sec elapsed 0.02 sec.
> INFO:  Pages 79: Changed 1, Empty 0; Tup 1: Vac 11348, Keep 0, UnUsed 0.
>     Total CPU 0.03s/0.06u sec elapsed 0.14 sec.

Vacuum (regular, not full) frequently enough that the 'Pages' value
doesn't increase past 1 and you'll be fine.  A sequential scan on a very
small table is what you want to have.

In this particular case, vacuum removed over 11000 dead versions of the
tuple.

An 8 k page will hold approx 140 tuples based on your structure.  So,
for every ~100 updates you'll want to run vacuum (regular, not full) on
the table.

-- 
Rod Taylor <rbt@rbt.ca>

PGP Key: http://www.rbt.ca/rbtpub.asc

Attachments:

  signature.asc (application/pgp-signature, 186B) download

view thread (8+ messages)  latest in thread

Message-ID: <1054434573.11968.42.camel@jester>
Permalink:  ../1054434573.11968.42.camel@jester/
Also on:    postgresql.org/message-id/1054434573.11968.42.camel@jester

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: rbt@rbt.ca, postgresql-to.dave@dave.to, pgsql-bugs@postgresql.org
  Subject: Re: Index speeds up one row table (why)?
  In-Reply-To: <1054434573.11968.42.camel@jester>
  References: <3ED93338.80806@dave.to> <1054434573.11968.42.camel@jester>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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