pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Greg Williamson <gwilliamson39@yahoo.com>
To: Samuel Stearns <SStearns@internode.com.au>
To: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: Re: pg_* Tables
Date: Sun, 5 Dec 2010 23:03:51 -0800 (PST)
Message-ID: <181094.9124.qm@web46106.mail.sp1.yahoo.com> (raw)
In-Reply-To: <68B59BEDCD36854AADBDF17E91B2937A07844CCA60@EXCHMAIL.staff.internode.com.au>
References: <68B59BEDCD36854AADBDF17E91B2937A07844CCA60@EXCHMAIL.staff.internode.com.au>

Samuel Stearns wrote:



>> Howdy,
>> 

>> Environment:
>>  

>> Solaris 10
>> Postgres 8.3.3
>>  

>> I’m getting high sequential scans for some pg_* tables:
>>  

>> <database>=# select relname, sum(seq_scan) as seq_scan,sum(seq_tup_read)
>> as seq_tup_read,sum(idx_scan) as idx_scan, sum(idx_tup_fetch) as 
>idx_tup_fetch,
>> sum(n_tup_ins) as n_tup_ins, sum(n_tup_upd) as n_tup_upd, sum(n_tup_del) as 
>>n_tup_del
>> from  pg_stat_all_tables group by 1 order by 2 desc limit 4;
>>              relname             | seq_scan | seq_tup_read | idx_scan | 
>>idx_tup_fetch | n_tup_ins | n_tup_upd | n_tup_del
>>---------------------------------+----------+--------------+----------+---------------+-----------+-----------+-----------
>>-
>> <table> |  6896498 |     91295702 |   107663 |        469057 |    103966 |    
>>103966 |    103966
>> pg_authid                       |  3119053 |    125950392 | 12000732 |      
>>12000718 |         1 |         1 |         0
>> pg_am                           |  2642438 |      2642440 |        5 
>>|             5 |         0 |         0 |         0
>> pg_database                     |  1349020 |     14771768 |  6953392 |       
>>6953392 |         0 |         0 |         0<...>
>> Is this normal?  Is it advisable to index pg_* tables?
 Do you vacuum the database regularly ?

What are the number of rows in those tables ?

It is possible that the planner is doing a sequential scan because the tables 
are small and that's faster than doing indexed reads.

Greg Williamson


      

view thread (3+ messages)  latest in thread

Message-ID: <181094.9124.qm@web46106.mail.sp1.yahoo.com>
Permalink:  ../181094.9124.qm@web46106.mail.sp1.yahoo.com/
Also on:    postgresql.org/message-id/181094.9124.qm@web46106.mail.sp1.yahoo.com

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: gwilliamson39@yahoo.com, SStearns@internode.com.au
  Subject: Re: pg_* Tables
  In-Reply-To: <181094.9124.qm@web46106.mail.sp1.yahoo.com>

* 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