Received: from jupiter.hub.org (jupiter.hub.org [64.49.215.5]) by postgresql.org (Postfix) with ESMTP id 9D437475A8C; Fri, 15 Mar 2002 19:06:06 -0500 (EST) Received: (from news@localhost) by jupiter.hub.org (8.11.6/8.11.6) id g2G04vX69125; Fri, 15 Mar 2002 18:04:57 -0600 (CST) (envelope-from news) From: Sergio Freue X-Newsgroups: comp.databases.postgresql.sql, comp.databases.postgresql.novice, comp.databases.postgresql.general Subject: Re: Why is it not using an index? Date: Fri, 15 Mar 2002 21:03:21 -0300 Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 16 Message-ID: <3C928BC9.90305@yahoo.com> References: <3C924680.4090806@openratings.com> Reply-To: sfreue_@_yahoo.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: news@hub.org User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9) Gecko/20020311 X-Accept-Language: en-us, en To: pgsql-general@postgresql.org.pgsql-sql@postgresql.org X-Archive-Number: 200203/855 X-Sequence-Number: 22227 I had the same problem and the question was answered here yesterday: > > explain select * from a where x=3; > Try explain select * from a where x=3::smallint; That should do it. I opted for changing all indexed SMALLINT fields to INTEGER.