Re: Query runs 38 seconds for small database! - Mailing list pgsql-performance

From Tom Lane
Subject Re: Query runs 38 seconds for small database!
Date
Msg-id 26838.1147099614@sss.pgh.pa.us
Whole thread Raw
In response to Query runs 38 seconds for small database!  ("Andrus" <eetasoft@online.ee>)
List pgsql-performance
"Andrus" <eetasoft@online.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

pgsql-performance by date:

Previous
From: "Andrus"
Date:
Subject: Query runs 38 seconds for small database!
Next
From: Vivek Khera
Date:
Subject: Re: Memory and/or cache issues?