Re: Interpreting statistics collector output - Mailing list pgsql-general

From Decibel!
Subject Re: Interpreting statistics collector output
Date
Msg-id 20070815155227.GF54135@nasby.net
Whole thread Raw
In response to Re: Interpreting statistics collector output  (Steve Madsen <steve@lightyearsoftware.com>)
Responses Re: Interpreting statistics collector output
List 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@decibel.org
EnterpriseDB      http://enterprisedb.com      512.569.9461 (cell)

Attachment

pgsql-general by date:

Previous
From: Erik Jones
Date:
Subject: Re: is this trigger safe and efective? - locking (caching via triiggers)
Next
From: Andrew Edson
Date:
Subject: Re: Select time jump after adding filter; please help me figure out what I'm doing wrong.