Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 7D7BF1337B82 for ; Tue, 26 Apr 2011 12:36:58 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 21609-01-3; Tue, 26 Apr 2011 15:36:50 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-vw0-f46.google.com (mail-vw0-f46.google.com [209.85.212.46]) by mail.postgresql.org (Postfix) with ESMTP id 45DD01337B97; Tue, 26 Apr 2011 12:36:50 -0300 (ADT) Received: by vws1 with SMTP id 1so539563vws.19 for ; Tue, 26 Apr 2011 08:36:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=XwIVdX3ByZ5Urws4zoFuo6ZT2Hz+epsOT3qhS/wk5QI=; b=BG1+eI93a5X9+wT0wq4OHU/FOPTqedHuUTBzgh4zTsHBrnl9xonaZCqrosENcUPb0k zymXiS3Apf5jeAA9yNyDYpQmCvvGpSVW/IU04anEhWy+I4qZ2lJX6z+wg8YJOzSG/Vjt ljcPs1TX81virF3N+Dh5LOaVqCyAK/XGnMWt0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=lKwrHkxqG175yh8WhvPhLpb3gLuLnzQ8YMz9AjrwzmGBda2+9sBpMqx858I0ND2Yfk TJG+RNVeA5VGffFW8rRehdDM0+jmkQGRNffM18wBfDxqdIAE1vS5bEDunCGDIkCETMh8 n/sberKc8o6ppqHRNfAKbgSticzv1q5IQmqs8= MIME-Version: 1.0 Received: by 10.52.113.193 with SMTP id ja1mr1336506vdb.183.1303832209742; Tue, 26 Apr 2011 08:36:49 -0700 (PDT) Received: by 10.52.182.4 with HTTP; Tue, 26 Apr 2011 08:36:49 -0700 (PDT) Date: Tue, 26 Apr 2011 17:36:49 +0200 Message-ID: Subject: [GENERAL]auto vacuum during restore From: Willy-Bas Loos To: pgsql-general@postgresql.org, pgsql-admin Content-Type: multipart/alternative; boundary=bcaec548a6f9b55c3004a1d4172b X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.897 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RFC_ABUSE_POST=0.001 X-Spam-Level: X-Archive-Number: 201104/228 X-Sequence-Number: 37409 --bcaec548a6f9b55c3004a1d4172b Content-Type: text/plain; charset=ISO-8859-1 Hi, i've tested on 8.3 and 8.4 and i found that autovacuum works during restore uin my test scenario, which is: a new database wit two tables. tab1 has 1M recs, tab2 has 10 recs. When i drop the database and restore, pg_stat_all tables tells me good estimations for the number of live tuples. But on a copy of a live database (postgres 8.3), there are zeros for n_live_tup on tables that do contain records. When i do an ANALYZE (without vacuum) these remain 0. When i do VACUUM ANALYZE, they are filled in correctly. I don't get it, they should have been analyzed at restore, should they not? Cheers, WBL -----------non default postgresql.conf settings below------------ $ grep ^[^#] /etc/postgresql/8.3/oz/postgresql.conf|grep -e ^[^[:space:]] data_directory = '/data/postgresql/8.3/oz' # use data in another directory hba_file = '/etc/postgresql/8.3/oz/pg_hba.conf' # host-based authentication file ident_file = '/etc/postgresql/8.3/oz/pg_ident.conf' # ident configuration file external_pid_file = '/var/run/postgresql/8.3-oz.pid' # write an extra PID file listen_addresses = '*' # what IP address(es) to listen on; port = 5434 # (change requires restart) max_connections = 100 # (change requires restart) unix_socket_directory = '/var/run/postgresql' # (change requires restart) tcp_keepalives_idle = 120 # TCP_KEEPIDLE, in seconds; shared_buffers = 2048MB # min 128kB or max_connections*16kB work_mem = 50MB # min 64kB maintenance_work_mem = 200MB # min 1MB max_fsm_pages = 3000000 # min max_fsm_relations*16, 6 bytes each max_fsm_relations = 10000 # min 100, ~70 bytes each synchronous_commit = off # immediate fsync at commit wal_writer_delay = 500ms # 1-10000 milliseconds commit_delay = 500 # range 0-100000, in microseconds effective_cache_size = 4096MB default_statistics_target = 100 # range 1-1000 log_min_duration_statement = 300000 # -1 is disabled, 0 logs all statements log_line_prefix = '%t ip:%h ' # special values: datestyle = 'iso, mdy' lc_messages = 'en_US.UTF-8' # locale for system error message lc_monetary = 'en_US.UTF-8' # locale for monetary formatting lc_numeric = 'en_US.UTF-8' # locale for number formatting lc_time = 'en_US.UTF-8' # locale for time formatting default_text_search_config = 'pg_catalog.english' -- "Patriotism is the conviction that your country is superior to all others because you were born in it." -- George Bernard Shaw --bcaec548a6f9b55c3004a1d4172b Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi,

i've tested on 8.3 and 8.4 and i found that auto= vacuum works during restore uin my test scenario, which is:
a new= database wit two tables. tab1 has 1M recs, tab2 has 10 recs.
When i drop the database and restore, pg_stat_all tables tells me good esti= mations for the number of live tuples.

But on a co= py of a live database (postgres 8.3), there are zeros for n_live_tup on tab= les that do contain records.
When i do an ANALYZE (without vacuum) these remain 0. When i do VACUUM= ANALYZE, they are filled in correctly.

I don'= t get it, they should have been analyzed at restore, should they not?

Cheers,

WBL

-----------non default postgresql.conf settings below------------
$ grep ^[^#] /etc/postgresql/8.3/oz/postgresql.conf|grep -e ^[= ^[:space:]]
data_directory =3D '/data/postgresql/8.3/oz' # use data in another directory
hba_f= ile =3D '/etc/postgresql/8.3/oz/pg_hba.conf' # host-based authentication file
ident_file =3D '/etc/postgresql/8.3/oz/pg_ident.conf' # ident configuration file
ex= ternal_pid_file =3D '/var/run/postgresql/8.3-oz.pid' # write an extra PID file
listen_addresses =3D '*' = # what IP address(es) to listen on;
port =3D 5434 # (change requires restart)
max_connections =3D 100 = # (change requires restart)
unix_socket_directory =3D '/var/r= un/postgresql' # (change r= equires restart)
tcp_keepalives_idle =3D 120 # TCP_KEEPIDLE, in seconds;
shared_buffers =3D 2048MB # min 128kB or max_connections*16kB
work_mem =3D 50MB # min= 64kB
maintenance_work_mem =3D 200MB # min 1MB
max_fsm_pages =3D 3000000 # min max_fsm_relations*16, 6 bytes eac= h
max_fsm_relations =3D 10000 # min 100, ~70 bytes each
synchronous_commit =3D off # immediate fsync at commit
wal_writer_delay =3D 500ms # 1-10000 milliseconds
commit_delay =3D 500 # range 0-100000, in microseconds
effective_cache_size =3D 4096MB
default_statistics_target = =3D 100 # range 1-1000
log_min_duration_statement =3D 300000 # -1 is disabled, 0 logs all statements
log_line_prefix =3D '%t ip:%h ' # special values:
datestyle =3D 'iso, mdy'= ;
lc_messages =3D 'en_US.UTF-8' # locale for system error message
lc_monetary =3D 'en_US.UTF-8' # locale for monetary formatting
lc_numeric =3D = 9;en_US.UTF-8' # locale f= or number formatting
lc_time =3D 'en_US.UTF-8'= # locale for time formatting
default_text_search_confi= g =3D 'pg_catalog.english'



--
"Patriotism is the conviction that y= our country is superior to all others because you were born in it." --= George Bernard Shaw
--bcaec548a6f9b55c3004a1d4172b--