From: Kjeld Peters <kjeld.peters@profiling-company.de>
To: Markus Schaber <schabi@logix-tt.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Created Index is not used
Date: Thu, 23 Feb 2006 15:09:10 +0100
Message-ID: <43FDC206.2090102@profiling-company.de> (raw)
In-Reply-To: <43FDAE8A.60805@logix-tt.com>
References: <43FDAC27.7050305@profiling-company.de>
<43FDAE8A.60805@logix-tt.com>
Hi Markus,
first of all thanks for your quick reply!
Markus Schaber wrote:
> 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.
After I appended "::int8" to the query, selecting the table takes only
40-50ms. That's a great performance boost!
> 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.
I guess I'll test an upgrade to version 8.1.
Thanks again for your and Ragnar's help!
Kjeld
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: kjeld.peters@profiling-company.de, schabi@logix-tt.com
Subject: Re: Created Index is not used
In-Reply-To: <43FDC206.2090102@profiling-company.de>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox