Re: Query runs 38 seconds for small database!

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>> "                    ->  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




[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux