pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jeremy M. Guthrie <jeremy.guthrie@berbee.com>
To: pgsql-performance@postgresql.org
Subject: Stuck using Sequential Scan
Date: Tue, 7 Sep 2004 16:32:03 -0500
Message-ID: <200409071632.05374.jeremy.guthrie@berbee.com> (raw)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I have a problem where I have the table format listed below.  I have the 
primary key tsyslog_id and the index built against it.  However, when I 
select a unique row, it will only ever do a seq scan even after I turn off 
all other types except indexscan.  I understand you cannot fully turn off seq 
scan.  

Syslog_TArchive size:  1,426,472,960 bytes
syslog_tarchive_pkey size:  132,833,280 bytes
archhost_idx size:  300,802,048 bytes
tarchdatetime_idx size:  159,293,440 bytes
tarchhostid_idx size:  362,323,968 bytes

I cannot run vacuum more than once a day because of its heavy IO penalty.  I 
run analyze once an hour.  However, if I run analyze then explain, I see no 
difference in the planners decisions.  What am I missing?


TSyslog=# \d syslog_tarchive;
                                        Table "public.syslog_tarchive"
   Column   |          Type          |                                
Modifiers
- ------------+------------------------+-------------------------------------------------------------------------
 tsyslog_id | bigint                 | not null default 
nextval('public.syslog_tarchive_tsyslog_id_seq'::text)
 facility   | integer                |
 severity   | integer                |
 date       | date                   |
 time       | time without time zone |
 host       | character varying(128) |
 message    | text                   |
Indexes:
    "syslog_tarchive_pkey" primary key, btree (tsyslog_id)
    "archhost_idx" btree (host)
    "tarchdatetime_idx" btree (date, "time")
    "tarchhostid_idx" btree (tsyslog_id, host)

TSyslog=# explain select * from tsyslog where tsyslog_id=431650835;
                               QUERY PLAN
- -------------------------------------------------------------------------
 Seq Scan on tsyslog  (cost=100000000.00..100000058.20 rows=2 width=187)
   Filter: (tsyslog_id = 431650835)
(2 rows)

- -- 

- --------------------------------------------------
Jeremy M. Guthrie        jeremy.guthrie@berbee.com
Senior Network Engineer        Phone: 608-298-1061
Berbee                           Fax: 608-288-3007
5520 Research Park Drive         NOC: 608-298-1102
Madison, WI 53711
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFBPijTqtjaBHGZBeURAndgAJ4rT2NpG9aGAdogoZaV+BvUfF6TjACfaexf
LrBzhDQK72u8dCUuPOSHB+Y=
=DSxi
-----END PGP SIGNATURE-----



view thread (2+ messages)  latest in thread

Message-ID: <200409071632.05374.jeremy.guthrie@berbee.com>
Permalink:  ../200409071632.05374.jeremy.guthrie@berbee.com/
Also on:    postgresql.org/message-id/200409071632.05374.jeremy.guthrie@berbee.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-performance@postgresql.org
  Cc: jeremy.guthrie@berbee.com
  Subject: Re: Stuck using Sequential Scan
  In-Reply-To: <200409071632.05374.jeremy.guthrie@berbee.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