X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id EF215D1B18A for ; Wed, 19 May 2004 18:51:20 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 24441-06 for ; Wed, 19 May 2004 18:51:02 -0300 (ADT) Received: from bob.samurai.com (bob.samurai.com [205.207.28.75]) by svr1.postgresql.org (Postfix) with ESMTP id A9D4BD1B34A for ; Wed, 19 May 2004 18:50:59 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by bob.samurai.com (Postfix) with ESMTP id 33BEA1FE1; Wed, 19 May 2004 17:51:01 -0400 (EDT) Received: from bob.samurai.com ([127.0.0.1]) by localhost (bob.samurai.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 91247-01-5; Wed, 19 May 2004 17:51:00 -0400 (EDT) Received: from [24.156.130.254] (CPE000a95ab279e-CM014470008056.cpe.net.cable.rogers.com [24.156.130.254]) by bob.samurai.com (Postfix) with ESMTP id 5A30F1FD0; Wed, 19 May 2004 17:51:00 -0400 (EDT) Message-ID: <40ABD6CC.3070206@samurai.com> Date: Wed, 19 May 2004 17:51:08 -0400 From: Neil Conway User-Agent: Mozilla Thunderbird 0.6 (Macintosh/20040502) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Eugeny Balakhonov Cc: pgsql-performance@postgresql.org Subject: Re: PostgreSQL performance in simple queries References: <1117434122.20040520000757@mail.ru> In-Reply-To: <1117434122.20040520000757@mail.ru> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at mailbox.samurai.com X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.1 tagged_above=0.0 required=5.0 tests=RCVD_IN_SORBS X-Spam-Level: X-Archive-Number: 200405/157 X-Sequence-Number: 6988 Eugeny Balakhonov wrote: > I tries to run simple query: > > select * from files_t where parent = 3333 Use this instead: select * from files_t where parent = '3333'; ("parent = 3333::int8" would work as well.) PostgreSQL (< 7.5) won't consider using an indexscan when the predicate involves an integer literal and the column datatype is int2 or int8. -Neil