Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id AEEF81337B7A for ; Thu, 27 Jan 2011 10:30:23 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 05352-10 for ; Thu, 27 Jan 2011 14:30:16 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from smtp.peak6.com (unknown [38.98.137.6]) by mail.postgresql.org (Postfix) with ESMTP id 271AB1337B4E for ; Thu, 27 Jan 2011 10:30:16 -0400 (AST) X-AuditID: 0a64cb1e-b7c55ae000000bfb-8f-4d4181786f73 Message-ID: <4D418177.1040401@peak6.com> Date: Thu, 27 Jan 2011 08:30:15 -0600 From: Shaun Thomas Reply-To: sthomas@peak6.com Organization: Peak6 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.7) Gecko/20100720 Lightning/1.0b2 Thunderbird/3.1.1 MIME-Version: 1.0 To: Tom Lane CC: David Greco , "pgsql-performance@postgresql.org" Subject: Re: Real vs Int performance References: <26917.1296079932@sss.pgh.pa.us> <21353.1296137891@sss.pgh.pa.us> In-Reply-To: <21353.1296137891@sss.pgh.pa.us> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed content-transfer-encoding: 7bit X-Brightmail-Tracker: AAAAAQAAAZE= X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.107 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RDNS_NONE=0.793 X-Spam-Level: X-Archive-Number: 201101/263 X-Sequence-Number: 42050 On 01/27/2011 08:18 AM, Tom Lane wrote: > Not if you can persuade the client-side code to output integers as > integers. "numeric" type is orders of magnitude slower than integers. I sadly have to vouch for this. My company converted an old Oracle app and they changed all their primary keys (and foreign keys, and random larger int fields) to NUMERIC(19)'s. I've convinced them all new stuff should be BIGINT if they need that level of coverage, but the damage is already done. I'm not sure about orders of magnitude on the storage/index side, but my tests gave us a 10% boost if just the keys are switched over to INT or BIGINT. -- Shaun Thomas OptionsHouse | 141 W. Jackson Blvd. | Suite 800 | Chicago IL, 60604 312-676-8870 sthomas@peak6.com ______________________________________________ See http://www.peak6.com/email_disclaimer.php for terms and conditions related to this email