"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