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 602725E46D9 for ; Fri, 13 Aug 2004 12:20:07 -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 89519-08 for ; Fri, 13 Aug 2004 15:20:13 +0000 (GMT) Received: from anchor-post-32.mail.demon.net (anchor-post-32.mail.demon.net [194.217.242.90]) by svr1.postgresql.org (Postfix) with ESMTP id B253F5E46D7 for ; Fri, 13 Aug 2004 12:20:00 -0300 (ADT) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-32.mail.demon.net with esmtp (Exim 3.35 #1) id 1Bvdqg-000Dj9-0W; Fri, 13 Aug 2004 15:20:06 +0000 Received: from [192.168.1.17] (client17.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id AF59A16B85; Fri, 13 Aug 2004 16:20:04 +0100 (BST) Message-ID: <411CDC24.4090706@archonet.com> Date: Fri, 13 Aug 2004 16:20:04 +0100 From: Richard Huxton User-Agent: Mozilla Thunderbird 0.7 (X11/20040615) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Arash Zaryoun Cc: pgsql-performance@postgresql.org Subject: Re: Weird Database Performance problem! References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit 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: 200408/210 X-Sequence-Number: 7846 Arash Zaryoun wrote: > Hi, > > We are having a performance problem with our database. The problem > exists when we include a constraint in GCTBALLOT. The constraint is as > follows: > > alter table GCTBALLOT > add constraint FK_GCTBALLOT_GCTWEBU foreign key (GCTWEBU_SRL) > references GCTWEBU (SRL) > on delete restrict on update restrict; > > The two tables that we insert into are the following: > GCTBALLOT: > gctwebu_srl | numeric(12,0) | > GCTWEBU: > srl | integer | not null default Your types don't match. You have a numeric referencing an integer. PG probably isn't using the index (it's smarter about this in 8.0 iirc). HTH -- Richard Huxton Archonet Ltd