X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 5F3B39DC87D for ; Fri, 20 Jan 2006 11:35:20 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 92269-07 for ; Fri, 20 Jan 2006 11:35:24 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 8D57A9DC820 for ; Fri, 20 Jan 2006 11:35:17 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id k0KFZLGn017455; Fri, 20 Jan 2006 10:35:21 -0500 (EST) To: Stephan Vollmer cc: pgsql-general@postgresql.org Subject: Re: Creation of tsearch2 index is very slow In-reply-to: <43D0ED57.1020608@gmx.de> References: <43D0ED57.1020608@gmx.de> Comments: In-reply-to Stephan Vollmer message dated "Fri, 20 Jan 2006 15:01:59 +0100" Date: Fri, 20 Jan 2006 10:35:21 -0500 Message-ID: <17454.1137771321@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.094 required=5 tests=[AWL=0.094] X-Spam-Score: 0.094 X-Spam-Level: X-Archive-Number: 200601/1000 X-Sequence-Number: 89945 Stephan Vollmer writes: > I noticed that the creation of a GIST index for tsearch2 takes very > long - about 20 minutes. CPU utilization is 100 %, the resulting > index file size is ~25 MB. Is this behaviour normal? This has been complained of before. GIST is always going to be slower at index-building than btree; in the btree case there's a simple optimal strategy for making an index (ie, sort the keys) but for GIST we don't know anything better to do than insert the keys one at a time. However, I'm not sure that anyone's tried to do any performance optimization on the GIST insert code ... there might be some low-hanging fruit there. It'd be interesting to look at a gprof profile of what the backend is doing during the index build. Do you have the ability to do that, or would you be willing to give your data to someone else to investigate with? (The behavior is very possibly data-dependent, which is why I want to see a profile with your specific data and not just some random dataset or other.) regards, tom lane