Re: Interpreting statistics collector output

From: Decibel! <decibel(at)decibel(dot)org>
To: Steve Madsen <steve(at)lightyearsoftware(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Interpreting statistics collector output
Date: 2007-08-15 15:52:27
Message-ID: 20070815155227.GF54135@nasby.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Aug 09, 2007 at 09:14:55PM -0400, Steve Madsen wrote:
> On Aug 8, 2007, at 6:08 PM, Decibel! wrote:
> >Something else I like to look at is pg_stat_all_tables seq_scan and
> >seq_tup_read. If seq_scan is a large number and seq_tup_read/
> >seq_scan is
> >also large, that indicates that you could use an index on that table.
>
> If seq_tup_read / seq_scan is large relative to the number of rows in
> the table, wouldn't that imply that those sequential scans are often
> returning most of the rows in the table? In that case, would an
> index help much or is a sequential scan the expected result?

I can't really think of a case where a seqscan wouldn't return all the
rows in the table... that's what it's meant to do.

What I was driving at by looking at seq_tup_read is that a small table
isn't going to use indexes anyway, so for the small tables it's
generally not worth worrying about indexes. If you wanted to be more
accurate you could look at reltuples or maybe relpages in pg_class
instead.
--
Decibel!, aka Jim Nasby decibel(at)decibel(dot)org
EnterpriseDB http://enterprisedb.com 512.569.9461 (cell)

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andrew Edson 2007-08-15 15:53:06 Re: Select time jump after adding filter; please help me figure out what I'm doing wrong.
Previous Message Decibel! 2007-08-15 15:47:47 Re: [GENERAL] Permission ALTER PASSWORD