X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id ED1AFD1E14C for ; Fri, 19 Mar 2004 04:23:41 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 45088-04 for ; Fri, 19 Mar 2004 00:23:39 -0400 (AST) Received: from ram.rentec.com (ram.rentec.com [192.5.35.66]) by svr1.postgresql.org (Postfix) with ESMTP id 330E5D1DC9E for ; Fri, 19 Mar 2004 00:23:38 -0400 (AST) Received: from rentec.com (stangesun.rentec.com [172.16.160.106]) by ram.rentec.com (8.12.1/8.12.1) with ESMTP id i2J4NYNb025091 for ; Thu, 18 Mar 2004 23:23:35 -0500 (EST) Message-ID: <405A7576.9000208@rentec.com> Date: Thu, 18 Mar 2004 23:22:14 -0500 From: Alan Stange User-Agent: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.7a) Gecko/20040219 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: vacuum performance Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200403/277 X-Sequence-Number: 6133 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