Re: NUMERIC private methods? - Mailing list pgsql-hackers

From Andrew Gierth
Subject Re: NUMERIC private methods?
Date
Msg-id 87fvcdljq2.fsf@news-spur.riddles.org.uk
Whole thread Raw
In response to Re: NUMERIC private methods?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: NUMERIC private methods?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
>>>>> "Tom" == Tom Lane <tgl@sss.pgh.pa.us> writes:
>> Hmm. You'd want to make add_var, mul_var etc. non-static?
Tom> -1 for that.

possibly with more meaningful names.
Tom> If you're concerned about arithmetic performance, there is aTom> very obvious fix here: use double.

Independently of this specific example, the obvious issue there is that
there are applications for which double is simply not acceptable.

As it stands, no extension can use the numeric type in any non-trivial
way without paying a large penalty for repeated pallocs and data copies.
Given that the ability to write C extensions easily is one of pg's great
strengths, this is a defect that should be corrected.
Tom> (It would still be orders of magnitude slower, no matter howTom> much we were willing to destroy numeric.c's
modularityTom>boundary.)
 

There is no need to expose any details of NumericVar's implementation;
it would suffice to provide an interface to allocate NumericVars, and
access to the functions.

-- 
Andrew (irc:RhodiumToad)



pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: [REVIEW] Re: Compression of full-page-writes
Next
From: Petr Jelinek
Date:
Subject: Re: TABLESAMPLE patch