Stuck using Sequential Scan

Поиск
Список
Период
Сортировка
От Jeremy M. Guthrie
Тема Stuck using Sequential Scan
Дата
Msg-id 200409071632.05374.jeremy.guthrie@berbee.com
обсуждение исходный текст
Ответы Re: Stuck using Sequential Scan  (Oliver Elphick <olly@lfix.co.uk>)
Список pgsql-performance
-----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-----

В списке pgsql-performance по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Interesting performance behaviour
Следующее
От: Mischa Sandberg
Дата:
Сообщение: Re: Equivalent praxis to CLUSTERED INDEX?