Re: [HACKERS] regression bigtest needs very long time - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] regression bigtest needs very long time
Date
Msg-id 22089.930753231@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] regression bigtest needs very long time  (Michael Robinson <robinson@netrinsics.com>)
Responses Re: [HACKERS] regression bigtest needs very long time
List pgsql-hackers
Michael Robinson <robinson@netrinsics.com> writes:
> The question, though, becomes what percentage of operations on a 
> NUMERIC field are arithmetic, and what percentage are storage/retrieval.

Good point.

> For databases that simply store/retrieve data, your "optimization" will have
> the effect of significantly increasing format conversion overhead.  With a
> 512-byte table, four packed-decimal digits can be converted in two
> primitive operations, but base-10000 will require three divisions, 
> three subtractions, four additions, plus miscellaneous data shuffling.

That is something to worry about, but I think the present implementation
unpacks the storage format into calculation format before converting
to text.  Getting rid of the unpack step by making storage and calc
formats the same would probably buy enough speed to pay for the extra
conversion arithmetic.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Michael Richards
Date:
Subject: Re: [HACKERS] Getting number of tuples affected
Next
From: Vince Vielhaber
Date:
Subject: Re: [HACKERS] Getting number of tuples affected