mirror of
https://github.com/postgres/postgres.git
synced 2025-12-12 02:37:31 +03:00
Reimplement NUMERIC datatype using base-10000 arithmetic; also improve
some of the algorithms for higher functions. I see about a factor of ten speedup on the 'numeric' regression test, but it's unlikely that that test is representative of real-world applications. initdb forced due to change of on-disk representation for NUMERIC.
This commit is contained in:
@@ -2,15 +2,15 @@
|
||||
-- AGGREGATES
|
||||
--
|
||||
SELECT avg(four) AS avg_1 FROM onek;
|
||||
avg_1
|
||||
---------------------
|
||||
1.50000000000000000
|
||||
avg_1
|
||||
--------------------
|
||||
1.5000000000000000
|
||||
(1 row)
|
||||
|
||||
SELECT avg(a) AS avg_32 FROM aggtest WHERE a < 100;
|
||||
avg_32
|
||||
--------------------
|
||||
32.666666666666667
|
||||
avg_32
|
||||
---------------------
|
||||
32.6666666666666667
|
||||
(1 row)
|
||||
|
||||
-- In 7.1, avg(float4) is computed using float8 arithmetic.
|
||||
@@ -120,9 +120,9 @@ group by ten order by ten;
|
||||
(10 rows)
|
||||
|
||||
SELECT newavg(four) AS avg_1 FROM onek;
|
||||
avg_1
|
||||
---------------------
|
||||
1.50000000000000000
|
||||
avg_1
|
||||
--------------------
|
||||
1.5000000000000000
|
||||
(1 row)
|
||||
|
||||
SELECT newsum(four) AS sum_1500 FROM onek;
|
||||
|
||||
@@ -665,9 +665,9 @@ SELECT t1.id1, t1.result, t2.expected
|
||||
-- ******************************
|
||||
-- numeric AVG used to fail on some platforms
|
||||
SELECT AVG(val) FROM num_data;
|
||||
avg
|
||||
----------------------
|
||||
-13430913.5922423207
|
||||
avg
|
||||
------------------------
|
||||
-13430913.592242320700
|
||||
(1 row)
|
||||
|
||||
-- Check for appropriate rounding and overflow
|
||||
|
||||
Reference in New Issue
Block a user