Re: Query runs 38 seconds for small database!

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Andrus" <eetasoft(at)online(dot)ee>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Query runs 38 seconds for small database!
Date: 2006-05-08 14:46:54
Message-ID: 26838.1147099614@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

"Andrus" <eetasoft(at)online(dot)ee> writes:
> I have small database. However the following query takes 38 (!) seconds to
> run.
> How to speed it up (preferably not changing table structures but possibly
> creating indexes) ?

ANALYZE would probably help.

> " -> Seq Scan on konto dbkonto (cost=0.00..23.30 rows=1
> width=44) (actual time=0.017..1.390 rows=219 loops=1)"
> " Filter: (iseloom = 'A'::bpchar)"

Anytime you see a row estimate that far off about a simple single-column
condition, it means your statistics are out-of-date.

regards, tom lane

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Vivek Khera 2006-05-08 15:06:42 Re: Memory and/or cache issues?
Previous Message Andrus 2006-05-08 10:59:39 Query runs 38 seconds for small database!