Skip site navigation (1) Skip section navigation (2)

Re: [HACKERS] Reducing the overhead of NUMERIC data

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>,"Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>, pgsql-hackers(at)postgresql(dot)org,pgsql-patches(at)postgresql(dot)org
Subject: Re: [HACKERS] Reducing the overhead of NUMERIC data
Date: 2005-11-02 23:32:31
Message-ID: 43694C8F.8040508@dunslane.net (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
[patches removed]

Tom Lane wrote:

>Simon Riggs <simon(at)2ndquadrant(dot)com> writes:
>  
>
>>It seems straightforward enough to put in an additional test, similar to
>>the ones already there so that if its too big for a decimal we make it a
>>float straight away - only a float can be that big in that case. After
>>that I can't really see what the problem is?
>>    
>>
>
>Wrong answer.  You'll be introducing weird corner cases into the type
>resolution behavior.
>
>An approach that would actually have some credibility would be to not
>resolve constants to NUMERIC right away, but to invent an UNKNOWNNUMERIC
>pseudotype with coercion behavior comparable to the existing UNKNOWN
>type for string literals.  This has been proposed before but hasn't
>really been needed so far.  Of course, this converts the project from a
>minor localized hack on NUMERIC into a major piece of fiddling with the
>type resolution rules, with the potential for unforeseen side-effects on
>the behavior of other data types.  It might be worth doing anyway --- I
>don't recall at the moment what problems UNKNOWNNUMERIC was intended to
>solve, but if they're still open issues then it's something we ought to
>get around to sometime.
>
>
>  
>

Could someone please quantify how much bang we might get for what seems 
like quite a lot of bucks?

I appreciate the need for speed, but the saving here strikes me as 
marginal at best, unless my instincts are all wrong (quite possible)

cheers

andrew

In response to

Responses

pgsql-hackers by date

Next:From: Dave CramerDate: 2005-11-02 23:34:28
Subject: Re: 8.1RC1 fails to build on OS X (10.4)
Previous:From: Jim C. NasbyDate: 2005-11-02 23:28:25
Subject: Re: [HACKERS] Reducing the overhead of NUMERIC data

pgsql-patches by date

Next:From: Neil ConwayDate: 2005-11-02 23:57:39
Subject: Re: [PATCHES] Partitioning docs
Previous:From: Jim C. NasbyDate: 2005-11-02 23:28:25
Subject: Re: [HACKERS] Reducing the overhead of NUMERIC data

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group