Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 6D8171DB6346 for ; Mon, 7 May 2012 12:51:59 -0300 (ADT) Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SRQE8-0005ag-VP for pgsql-bugs@postgresql.org; Mon, 07 May 2012 15:51:58 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id q47Fpgcr027018; Mon, 7 May 2012 11:51:42 -0400 (EDT) To: Heikki Linnakangas cc: tom@tomforb.es, pgsql-bugs@postgresql.org Subject: Re: BUG #6629: Creating a gist index fails with "too many LWLocks taken" In-reply-to: <4FA7EC37.5070703@enterprisedb.com> References: <4FA7EC37.5070703@enterprisedb.com> Comments: In-reply-to Heikki Linnakangas message dated "Mon, 07 May 2012 18:37:27 +0300" Date: Mon, 07 May 2012 11:51:42 -0400 Message-ID: <27017.1336405902@sss.pgh.pa.us> From: Tom Lane X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201205/35 X-Sequence-Number: 33006 Heikki Linnakangas writes: > We could rearrange the page splitting algorithm to release locks > earlier, before traversing to the next parent level. That seems like a good idea just on concurrency grounds; I'm worried about both the performance implications and the risk of deadlock. > I wrote a quick patch to do that, and with the patch the index build > finished - but it took hours. And the index was 10GB in size, where the > heap is just 12 MB, and searches using the index take ages. Hm, is the example exploiting some pessimal behavior in the picksplit logic for the particular opclass? Maybe that's something to fix, too. regards, tom lane