Re: Numeric performances

From: PFC <lists(at)peufeu(dot)com>
To: "Lincoln Yeoh" <lyeoh(at)pop(dot)jaring(dot)my>, "Alvaro Herrera" <alvherre(at)commandprompt(dot)com>, "Vincenzo Romano" <vincenzo(dot)romano(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Numeric performances
Date: 2007-06-04 10:06:47
Message-ID: op.ttd6dlbgcigqcu@apollo13
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>> It is. But why do you care? You either have the correctness that
>> NUMERIC gives, or you don't.
>
> I suspect it's still useful to know what order of magnitude slower it
> is. After all if it is 1000x slower (not saying it is), some people may
> decide it's not worth it or roll their own.
>
> Any hints/gotchas for/when doing such performance tests?

forum_bench=> CREATE TEMPORARY TABLE test AS SELECT a::FLOAT AS f,
a::NUMERIC AS n, a::INTEGER AS i, a::BIGINT AS b FROM
generate_series( 1,100000 ) AS a;
SELECT
Temps : 1169,125 ms

forum_bench=> SELECT sum(i) FROM test;
Temps : 46,589 ms

forum_bench=> SELECT sum(b) FROM test;
Temps : 157,018 ms

forum_bench=> SELECT sum(f) FROM test;
Temps : 63,865 ms

forum_bench=> SELECT sum(n) FROM test;
Temps : 124,816 ms

SELECT * FROM test ORDER BY i LIMIT 1; SELECT * FROM test ORDER BY b LIMIT
1; SELECT * FROM test ORDER BY f LIMIT 1; SELECT * FROM test ORDER BY n
LIMIT 1;
Temps : 68,996 ms
Temps : 68,917 ms
Temps : 62,321 ms
Temps : 71,880 ms

BEGIN; CREATE INDEX test_i ON test(i); CREATE INDEX test_b ON test(b);
CREATE INDEX test_f ON test(f); CREATE INDEX test_n ON test(n); ROLLBACK;
CREATE INDEX
Temps : 102,901 ms
CREATE INDEX
Temps : 123,406 ms
CREATE INDEX
Temps : 105,255 ms
CREATE INDEX
Temps : 134,468 ms

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Vincenzo Romano 2007-06-04 10:23:18 Re: Numeric performances
Previous Message Teodor Sigaev 2007-06-04 10:06:06 Re: warm standby server stops doingcheckpointsafterawhile