R: slow seqscan after vacuum analize

From: "Edoardo Ceccarelli" <eddy(at)axa(dot)it>
To: "'scott(dot)marlowe'" <scott(dot)marlowe(at)ihs(dot)com>
Cc: <pgsql-admin(at)postgresql(dot)org>
Subject: R: slow seqscan after vacuum analize
Date: 2004-02-05 00:35:12
Message-ID: 2s28b9$kqihb@mailr-1.tiscali.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

> -----Messaggio originale-----
> Da: scott.marlowe [mailto:scott(dot)marlowe(at)ihs(dot)com]
> Inviato: mercoledì 4 febbraio 2004 22.45
> A: Edoardo Ceccarelli
> Cc: pgsql-admin(at)postgresql(dot)org
> Oggetto: Re: [ADMIN] slow seqscan after vacuum analize
>
> On Wed, 4 Feb 2004, Edoardo Ceccarelli wrote:
>
> > I have a simple query that scans each record, like this:
> select * from
> > utente where luogorilasciodoc='ciao'
> > The execution time BEFORE vacuum is: 1203ms The execution
> time AFTER
> > vacuum is: 6656ms !!!
> > What is going on? Thought that one vaccum the db to get
> better performance!
> >
> > PostgreSQL Ver. 7.3.4 on linux
>
> Can you show us the output of "explain analyze select * from
> ..." for both
> before and after a vacuum? i.e. with the difference in
> performance. If
> not, just an explain analyze of the way it runs now might be enough.
>

BEFORE (copy of the db without having run the vacuum):

explain analyze SELECT * FROM utente where luogorilasciodoc='ciao';
QUERY PLAN

--------------------------------------------------------------------------------------
----------------------
Seq Scan on utente (cost=0.00..40947.90 rows=1826 width=724) (actual
time=131.17..856.96 rows=15 loops=1)
Filter: (luogorilasciodoc = 'ciao'::bpchar)
Total runtime: 857.06 msec
(3 rows)

AFTER (actual db)
portaportese=# explain analyze SELECT * FROM utente where luogorilasciodoc='ciao';
QUERY PLAN

--------------------------------------------------------------------------------------
--------------------
Seq Scan on utente (cost=0.00..92174.50 rows=3 width=724) (actual
time=705.41..6458.19 rows=15 loops=1)
Filter: (luogorilasciodoc = 'ciao'::bpchar)
Total runtime: 6458.29 msec
(3 rows

Things are worst only for seqscan, when it uses indexscan timing is good.

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Sam Barnett-Cormack 2004-02-05 00:56:42 Re: R: slow seqscan after vacuum analize
Previous Message Harley Milne 2004-02-04 22:04:26 Windows Installer with Configuration Instructions