Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 5E587650EEE for ; Thu, 26 Jun 2008 02:34:44 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 22451-01-2 for ; Thu, 26 Jun 2008 02:34:33 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 0DE3E650F34 for ; Thu, 26 Jun 2008 02:33:32 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id m5Q5XUis005565; Thu, 26 Jun 2008 01:33:30 -0400 (EDT) To: Craig James cc: pgsql-performance@postgresql.org Subject: Re: Typecast bug? In-reply-to: <4863186E.1000306@emolecules.com> References: <47FFA7FF.10801@postnewspapers.com.au> <544D07A2-EB3F-4D91-A749-0C4D5D38AB80@gmail.com> <481F992D.7070509@emolecules.com> <4820A3C2.4000307@emolecules.com> <4820C30A.8010709@emolecules.com> <4863186E.1000306@emolecules.com> Comments: In-reply-to Craig James message dated "Wed, 25 Jun 2008 21:17:50 -0700" Date: Thu, 26 Jun 2008 01:33:30 -0400 Message-ID: <5564.1214458410@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200806/157 X-Sequence-Number: 30507 Craig James writes: > This seems like a bug to me, but it shows up as a performance problem. > emol_warehouse_1=> explain analyze select version_id, parent_id from version where version_id = 999999999999999999999999999; If you actually *need* so many 9's here as to force it out of the range of bigint, then why is your id column not declared numeric? This seems to me to be about on par with complaining that "intcol = 4.2e1" won't be indexed. We have a numeric data type hierarchy, learn to work with it ... regards, tom lane