I just loaded up 9GB of data (32 tables) into a brand new system (Postgres
7.4.5 on Linux 2.4 with 1GB ram, IDE). I immediately ran "vacuum analyze"
but Postgres seems to be writing a lot to disk even though none of the
tables have incurred any UPDATES or DELETES yet and there are no other
connections or process running. Is it normal for vacuum to be writing to
disk even when there is nothing to clean up?


procs                      memory      swap          io     system
cpu
 r  b   swpd   free   buff  cache   si   so    bi    bo   in    cs us sy id
wa
 0  2      0  18860  76336 870436    0    0   109   439  420   495  3  1 86
10
 0  2      0  20076  76344 870480    0    0   640    84  510   171  0  0  0
100
 0  2      0  19320  76344 871244    0    0   880  1636  392   244  0  0  0
100
 0  1      0  18920  76348 871740    0    0   876   940  317   295 13  0 14
73
 0  1      0  17184  76348 873476    0    0  1408     0  279   382  0  0  0
100
 0  1      0  16244  76348 874416    0    0  1280     0  271   404  0  0  0
99
 0  2      0  18484  76348 871088    0    0  1408  4560  323   415  0  1  0
99


avg-cpu:  %user   %nice    %sys   %idle
           3.66    0.00    0.50   95.84

Device:    rrqm/s wrqm/s   r/s   w/s  rsec/s  wsec/s    rkB/s    wkB/s
avgrq-sz avgqu-sz   await  svctm  %util
/dev/hdc    32.67 206.11 27.92 37.70  484.68 1951.29   242.34   975.65
37.12     2.93   15.50  16.93 111.13



db=# vacuum verbose analyze;
INFO:  analyzing "public.table_3e"
INFO:  "table_3e": 3233 pages, 3000 rows sampled, 69814 estimated total rows
INFO:  vacuuming "public.table_3f"
INFO:  index "table_3f_pkey" now contains 68928 row versions in 460 pages
DETAIL:  0 index pages have been deleted, 0 are currently reusable.
CPU 0.00s/0.00u sec elapsed 0.13 sec.
INFO:  "table_3f": found 0 removable, 68928 nonremovable row versions in
3255 pages
DETAIL:  0 dead row versions cannot be removed yet.
There were 0 unused item pointers.
0 pages are entirely empty.
CPU 0.06s/0.02u sec elapsed 18.71 sec.
INFO:  vacuuming "pg_toast.pg_toast_1439762"
INFO:  index "pg_toast_1439762_index" now contains 134585 row versions in
516 pages
DETAIL:  0 index pages have been deleted, 0 are currently reusable.
CPU 0.07s/0.02u sec elapsed 4.37 sec.
INFO:  "pg_toast_1439762": found 0 removable, 134585 nonremovable row
versions in 29894 pages
DETAIL:  0 dead row versions cannot be removed yet.
There were 0 unused item pointers.
0 pages are entirely empty.
CPU 1.08s/0.24u sec elapsed 53.02 sec.
...
...



Mon, 27 Sep 2004 10:04:02 -0400
"onion" <onion@taxi.com>
Vacuum writes on empty system
"onion" <onion@taxi.com> writes:
> I just loaded up 9GB of data (32 tables) into a brand new system (Postgres
> 7.4.5 on Linux 2.4 with 1GB ram, IDE). I immediately ran "vacuum analyze"
> but Postgres seems to be writing a lot to disk even though none of the
> tables have incurred any UPDATES or DELETES yet and there are no other
> connections or process running. Is it normal for vacuum to be writing to
> disk even when there is nothing to clean up?

Your assumption that there is nothing for VACUUM to do is mistaken.

It's probably setting the known-committed hint bits in all the tuple
headers of the newly loaded data.

			regards, tom lane

Fri, 01 Oct 2004 14:33:47 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: Vacuum writes on empty system 