pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Edoardo Ceccarelli <eddy@axa.it>
To: 'scott.marlowe' <scott.marlowe@ihs.com>
Cc: pgsql-admin@postgresql.org
Subject: R: slow seqscan after vacuum analize
Date: Thu, 5 Feb 2004 01:35:12 +0100
Message-ID: <2s28b9$kqihb@mailr-1.tiscali.it> (raw)
In-Reply-To: <Pine.LNX.4.33.0402041444060.29742-100000@css120.ihs.com>

> -----Messaggio originale-----
> Da: scott.marlowe [mailto:scott.marlowe@ihs.com] 
> Inviato: mercoledì 4 febbraio 2004 22.45
> A: Edoardo Ceccarelli
> Cc: pgsql-admin@postgresql.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.





view thread (6+ messages)  latest in thread

Message-ID: <2s28b9$kqihb@mailr-1.tiscali.it>
Permalink:  ../2s28b9$kqihb@mailr-1.tiscali.it/
Also on:    postgresql.org/message-id/2s28b9$kqihb@mailr-1.tiscali.it

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: eddy@axa.it, scott.marlowe@ihs.com
  Subject: Re: R: slow seqscan after vacuum analize
  In-Reply-To: <2s28b9$kqihb@mailr-1.tiscali.it>
  References: <Pine.LNX.4.33.0402041444060.29742-100000@css120.ihs.com> <2s28b9$kqihb@mailr-1.tiscali.it>

* 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