Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 391569FB329 for ; Wed, 4 Oct 2006 14:10:57 -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 05601-03 for ; Wed, 4 Oct 2006 17:10:51 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail.logix-tt.com (mail.logix-tt.com [212.211.145.186]) by postgresql.org (Postfix) with ESMTP id 8F0B59FB24B for ; Wed, 4 Oct 2006 14:10:51 -0300 (ADT) Received: from kingfisher.intern.logix-tt.com (p549D1602.dip0.t-ipconnect.de [84.157.22.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.logix-tt.com (Postfix) with ESMTP id 4E55865997 for ; Wed, 4 Oct 2006 19:13:16 +0200 (CEST) Received: from [127.0.0.1] (localhost [127.0.0.1]) by kingfisher.intern.logix-tt.com (Postfix) with ESMTP id CA8D018818CDE for ; Wed, 4 Oct 2006 19:10:48 +0200 (CEST) Message-ID: <4523EB18.4040408@logix-tt.com> Date: Wed, 04 Oct 2006 19:10:48 +0200 From: Markus Schaber Organization: Logical Tracking and Tracing International AG, Switzerland User-Agent: Thunderbird 1.5.0.5 (X11/20060812) MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: Poor performance on very simple query ? References: <45224896.7040708@freesurf.fr> <20061003121004.GC30211@oppetid.no> <20061003121109.GD30211@oppetid.no> <45225407.7090805@freesurf.fr> <20061003121709.GF30211@oppetid.no> In-Reply-To: <20061003121709.GF30211@oppetid.no> X-Enigmail-Version: 0.94.0.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.135 tagged_above=0 required=5 tests=FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200610/105 X-Sequence-Number: 21234 Hi, Tobias, Tobias Brox wrote: > How can you have a default value on a primary key? Just declare the column with both a default value and a primary key constraint. It makes sense when the default value is calculated instead of a constant, by calling a function that generates the key. In fact, the SERIAL type does nothing but defining a sequence, and then use nextval('sequencename') as default. HTH, Markus -- Markus Schaber | Logical Tracking&Tracing International AG Dipl. Inf. | Software Development GIS Fight against software patents in Europe! www.ffii.org www.nosoftwarepatents.org