X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 967529DC9B2 for ; Thu, 23 Feb 2006 09:07:56 -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 41332-04 for ; Thu, 23 Feb 2006 09:07:58 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail.tacotec.de (mail.tacotec.de [83.137.101.41]) by postgresql.org (Postfix) with ESMTP id A48109DC9E5 for ; Thu, 23 Feb 2006 09:07:52 -0400 (AST) Received: from localhost (localhost [127.0.0.1]) by mail.tacotec.de (Postfix) with ESMTP id 4521711D4ED; Thu, 23 Feb 2006 14:07:54 +0100 (CET) Received: from mail.tacotec.de ([83.137.101.41]) by localhost (hera.tacotec.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 28938-03; Thu, 23 Feb 2006 14:07:54 +0100 (CET) Received: from kingfisher.intern.logix-tt.com (Mea8d.m.pppool.de [89.49.234.141]) by mail.tacotec.de (Postfix) with ESMTP id E8A6911D3E5; Thu, 23 Feb 2006 14:07:53 +0100 (CET) Received: from [127.0.0.1] (localhost [127.0.0.1]) by kingfisher.intern.logix-tt.com (Postfix) with ESMTP id 379BB181C0F6B; Thu, 23 Feb 2006 13:46:04 +0100 (CET) Message-ID: <43FDAE8A.60805@logix-tt.com> Date: Thu, 23 Feb 2006 13:46:02 +0100 From: Markus Schaber Organization: Logical Tracking and Tracing International AG, Switzerland User-Agent: Debian Thunderbird 1.0.7 (X11/20051017) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Kjeld Peters Cc: pgsql-performance@postgresql.org Subject: Re: Created Index is not used References: <43FDAC27.7050305@profiling-company.de> In-Reply-To: <43FDAC27.7050305@profiling-company.de> X-Enigmail-Version: 0.93.0.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at mail.tacotec.de X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.122 required=5 tests=[AWL=0.122] X-Spam-Score: 0.122 X-Spam-Level: X-Archive-Number: 200602/365 X-Sequence-Number: 17351 Hi, Kjeld, Kjeld Peters wrote: > Select and update statements are quite slow on a large table with more > than 600,000 rows. The table consists of 11 columns (nothing special). > The column "id" (int8) is primary key and has a btree index on it. > > The following select statement takes nearly 500ms: > > SELECT * FROM table WHERE id = 600000; Known issue which is fixed in 8.X servers, postgreSQL sees your 600000 as int4 literal and does not grasp that the int8 index works for it. SELECT * FROM table WHERE id = 600000::int8; should do it. > SELECT version(); > "PostgreSQL 7.4.2 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.3.3 > (SuSE Linux)" Btw, you should update to 7.4.12, there are importand bug fixes and it is upgradable "in place", without dumping and reloading the database. HTH, Markus -- Markus Schaber | Logical Tracking&Tracing International AG Dipl. Inf. | Software Development GIS Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org