X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 301F7D1B8E8 for ; Tue, 8 Jun 2004 13:47:13 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 59823-08 for ; Tue, 8 Jun 2004 16:47:09 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 78F31D1B8C4 for ; Tue, 8 Jun 2004 13:47:08 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.11/8.12.11) with ESMTP id i58Gl8qd002961; Tue, 8 Jun 2004 12:47:08 -0400 (EDT) To: Litao Wu Cc: pgsql-performance@postgresql.org Subject: Re: reindex and copy - deadlock? In-reply-to: <20040608153106.61670.qmail@web13123.mail.yahoo.com> References: <20040608153106.61670.qmail@web13123.mail.yahoo.com> Comments: In-reply-to Litao Wu message dated "Tue, 08 Jun 2004 08:31:06 -0700" Date: Tue, 08 Jun 2004 12:47:08 -0400 Message-ID: <2960.1086713228@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200406/93 X-Sequence-Number: 7151 Litao Wu writes: > We often experience with the problem that reindex > cannot be finished in our production database. > It's typically done with 30 minutes. However, > sometimes, when there is another "COPY" process, > reindex will not finish. By monitoring the CPU > time reindex takes, it does not increase at all. > That seems a deadlock. There is no deadlock visible in your report: the reindex process is not waiting for a lock, according to either ps or pg_locks. You sure it's not just slow? I'd expect reindex to be largely I/O bound, so the lack of CPU activity doesn't prove much. If you think it's actually stuck waiting for something, try attaching to the REINDEX backend process with gdb to get a stack trace. That would at least give some idea what it's waiting for. regards, tom lane