X-Original-To: pgsql-performance-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id AC2029FB2A4 for ; Fri, 11 Aug 2006 08:48:19 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 71694-02 for ; Fri, 11 Aug 2006 11:48:11 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from nutty.inf.ed.ac.uk (nutty.inf.ed.ac.uk [129.215.216.3]) by postgresql.org (Postfix) with ESMTP id 8D2869FB1E7 for ; Fri, 11 Aug 2006 08:48:10 -0300 (ADT) Received: from [129.215.218.230] (skibo.inf.ed.ac.uk [129.215.218.230]) by nutty.inf.ed.ac.uk (8.13.6/8.13.6) with ESMTP id k7BBm1Gn025812; Fri, 11 Aug 2006 12:48:04 +0100 Message-ID: <44DC6E71.3030401@inf.ed.ac.uk> Date: Fri, 11 Aug 2006 12:48:01 +0100 From: Sue Fitt User-Agent: Thunderbird 1.5.0.4 (X11/20060620) MIME-Version: 1.0 To: Stephan Szabo CC: pgsql-performance@postgresql.org Subject: Re: setting up foreign keys References: <44DAE8CF.1030107@inf.ed.ac.uk> <20060810113004.K52796@megazone.bigpanda.com> In-Reply-To: <20060810113004.K52796@megazone.bigpanda.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200608/206 X-Sequence-Number: 20391 Solved, it turned out to be a lock caused by a gui connected to the database, even though the gui wasn't actually doing anything at the time... Sue Stephan Szabo wrote: > On Thu, 10 Aug 2006, Sue Fitt wrote: > > >> Hi all, >> >> This is my first post to the performance list, I hope someone can help me. >> >> I'm setting up a table with 2 columns, both of which reference a column >> in another table: >> >> CREATE TABLE headwords_core_lexemes ( >> core_id int REFERENCES headwords_core(core_id), >> lexeme_id int REFERENCES headwords_core(core_id), >> ); >> >> Trouble is, it's taken 18 hours and counting! >> > > What precisely is taking the time, the create table itself? The only thing > that the create should be waiting for as far as I know is a lock on > headwords_core to add the triggers. > > ---------------------------(end of broadcast)--------------------------- > TIP 9: In versions below 8.0, the planner will ignore your desire to > choose an index scan if your joining column's datatypes do not > match > >