vacuum performance

From: Alan Stange <stange(at)rentec(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Subject: vacuum performance
Date: 2004-03-19 04:22:14
Message-ID: 405A7576.9000208@rentec.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Hello all,

I have a question/observation about vacuum performance. I'm running
Solaris 9, pg 7.4.1.
The process in questions is doing a vacuum:

bash-2.05$ /usr/ucb/ps auxww | grep 4885
fiasco 4885 19.1 3.7605896592920 ? O 19:29:44 91:38 postgres:
fiasco fiasco [local] VACUUM

I do a truss on the process and see the output below looping over and
over. Note the constant opening and closing of the file 42064889.3.

Why the open/close cycle as opposed to caching the file descriptor
somewhere?

If PG really does need to loop like this, it should be much faster to
set the cwd and then open without the path in the file name. You're
forcing the kernel to do a lot of work walking the path, checking for
nfs mounts, symlinks, etc.

Thanks!

-- Alan

open64("/export/nst1/fi/pg/data1/base/91488/42064889.3", O_RDWR) = 47
llseek(47, 0x18F6E000, SEEK_SET) = 0x18F6E000
write(47, "\0\0\0 zA9A3D9E8\0\0\0 "".., 8192) = 8192
close(47) = 0
read(29, "\0\0\0 }ED WF1B0\0\0\0 $".., 8192) = 8192
open64("/export/nst1/fi/pg/data1/base/91488/42064889.3", O_RDWR) = 47
llseek(47, 0x18F78000, SEEK_SET) = 0x18F78000
write(47, "\0\0\0 zA9AC 090\0\0\0 "".., 8192) = 8192
close(47) = 0
llseek(43, 0x26202000, SEEK_SET) = 0x26202000
read(43, "\0\0\084 EC9FC P\0\0\0 )".., 8192) = 8192
semop(52, 0xFFBFC5E0, 1) = 0
semop(52, 0xFFBFC640, 1) = 0
open64("/export/nst1/fi/pg/data1/base/91488/42064889.3", O_RDWR) = 47
llseek(47, 0x18F62000, SEEK_SET) = 0x18F62000
write(47, "\0\0\0 zA9C2\bB8\0\0\0 "".., 8192) = 8192
close(47) = 0
read(29, "\0\0\0 }ED X1210\0\0\0 $".., 8192) = 8192
semop(52, 0xFFBFC5E0, 1) = 0
semop(52, 0xFFBFC640, 1) = 0
open64("/export/nst1/fi/pg/data1/base/91488/42064889.3", O_RDWR) = 47
llseek(47, 0x18018000, SEEK_SET) = 0x18018000
write(47, "\0\0\0 zA997ADB0\0\0\0 "".., 8192) = 8192
close(47) = 0
llseek(43, 0x26200000, SEEK_SET) = 0x26200000
read(43, "\0\0\084 EC4F5E8\0\0\0 )".., 8192) = 8192
semop(52, 0xFFBFC5E0, 1) = 0
semop(52, 0xFFBFC640, 1) = 0
llseek(13, 13918208, SEEK_SET) = 13918208
write(13, "D0 Z\001\0\0\0 )\0\0\087".., 8192) = 8192
write(13, "D0 Z\001\0\0\0 )\0\0\087".., 8192) = 8192
write(13, "D0 Z\001\0\0\0 )\0\0\087".., 8192) = 8192
write(13, "D0 Z\001\0\0\0 )\0\0\087".., 8192) = 8192
write(13, "D0 Z\001\0\0\0 )\0\0\087".., 8192) = 8192
open64("/export/nst1/fi/pg/data1/base/91488/42064889.3", O_RDWR) = 47
llseek(47, 0x18F52000, SEEK_SET) = 0x18F52000
write(47, "\0\0\0 zABE7 V10\0\0\0 "".., 8192) = 8192
close(47) = 0
semop(46, 0xFFBFC5D0, 1) = 0
read(29, "\0\0\0 }ED X 2 p\0\0\0 $".., 8192) = 8192
semop(52, 0xFFBFC5E0, 1) = 0
semop(52, 0xFFBFC640, 1) = 0
llseek(43, 0x270DA000, SEEK_SET) = 0x270DA000
write(43, "\0\0\087A2E8 #B8\0\0\0 )".., 8192) = 8192
llseek(43, 0x261FE000, SEEK_SET) = 0x261FE000
read(43, "\0\0\084 EC498\0\0\0\0 )".., 8192) = 8192
poll(0xFFBFC100, 0, 10) = 0
open64("/export/nst1/fi/pg/data1/base/91488/42064889.3", O_RDWR) = 47
llseek(47, 0x1804A000, SEEK_SET) = 0x1804A000
write(47, "\0\0\0 zAA0F8DE0\0\0\0 "".., 8192) = 8192
close(47) = 0
read(29, "\0\0\0 }ED X RD0\0\0\0 $".., 8192) = 8192
semop(52, 0xFFBFC5E0, 1) = 0
semop(52, 0xFFBFC640, 1) = 0
write(13, "D0 Z\001\0\0\0 )\0\0\087".., 8192) = 8192
write(13, "D0 Z\001\0\0\0 )\0\0\087".., 8192) = 8192
write(13, "D0 Z\001\0\0\0 )\0\0\087".., 8192) = 8192
write(13, "D0 Z\001\0\0\0 )\0\0\087".., 8192) = 8192
open64("/export/nst1/fi/pg/data1/base/91488/42064889.3", O_RDWR) = 47

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2004-03-19 06:18:20 Re: vacuum performance
Previous Message Bruce Momjian 2004-03-19 04:08:31 Re: [HACKERS] fsync method checking