pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andrus <eetasoft@online.ee>
Cc: pgsql-performance@postgresql.org
Subject: Re: Query runs 38 seconds for small database!
Date: Mon, 08 May 2006 10:46:54 -0400
Message-ID: <26838.1147099614@sss.pgh.pa.us> (raw)
In-Reply-To: <e3n8at$1f7i$1@news.hub.org>
References: <e3n8at$1f7i$1@news.hub.org>

"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



view thread (12+ messages)  latest in thread

Message-ID: <26838.1147099614@sss.pgh.pa.us>
Permalink:  ../26838.1147099614@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/26838.1147099614@sss.pgh.pa.us

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, eetasoft@online.ee
  Subject: Re: Query runs 38 seconds for small database!
  In-Reply-To: <26838.1147099614@sss.pgh.pa.us>

* 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