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

From Andrus
Subject Re: Query runs 38 seconds for small database!
Date
Msg-id e3nqv9$30v0$1@news.hub.org
Whole thread Raw
In response to Query runs 38 seconds for small database!  ("Andrus" <eetasoft@online.ee>)
Responses Re: Query runs 38 seconds for small database!
List pgsql-performance
>> "                    ->  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.

Than you. I addded ANALYZE command and now  query works fast.

I see autovacuum: processing database "mydb" messages in log file and I have

stats_start_collector = on
stats_row_level = on

in config file. Why statistics was out-of-date ?

Andrus.


My postgres.conf file (only uncommented settings are listed):

listen_addresses = '*'
max_connections = 40
shared_buffers = 1000
log_destination = 'stderr'
redirect_stderr = on   # Enable capturing of stderr into log
log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log' # Log file name pattern.
log_rotation_age = 1440  # Automatic rotation of logfiles will
log_rotation_size = 10240  # Automatic rotation of logfiles will
log_min_error_statement = 'warning' # Values in order of increasing
severity:
silent_mode = on
log_line_prefix = "'%t %u %d %h %p %i %l %x %q'"
stats_start_collector = on
stats_row_level = on
autovacuum = on   # enable autovacuum subprocess?
lc_messages = 'C'   # locale for system error message
lc_monetary = 'C'   # locale for monetary formatting
lc_numeric = 'C'   # locale for number formatting
lc_time = 'C'    # locale for time formatting



pgsql-performance by date:

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