Re: New version of money type

Поиск
Список
Период
Сортировка
От Andrew - Supernews
Тема Re: New version of money type
Дата
Msg-id slrneglkc8.2ea3.andrew+nonews@atlantis.supernews.net
обсуждение исходный текст
Ответ на New version of money type  ("D'Arcy J.M. Cain" <darcy@druid.net>)
Ответы Re: New version of money type  ("D'Arcy J.M. Cain" <darcy@druid.net>)
Список pgsql-hackers
On 2006-09-15, "D'Arcy J.M. Cain" <darcy@druid.net> wrote:
>> Seems? Have you benchmarked it?
>
> Not rigourously but a few "ANALYZE EXPLAIN" statements bear out this
> observation.

The overhead of EXPLAIN ANALYZE is so large that it completely swamps any
real difference.

>> The point is that bigint is _not_ faster than numeric for I/O (in fact
>> even integer is not faster than numeric for output).
>> 
>> Numbers from an actual benchmark:
>> 
>> int4out(0)     - 0.42us/call
>> numeric_out(0) - 0.32us/call
>> 
>> int4out(1000000000)     - 0.67us/call
>> numeric_out(1000000000) - 0.42us/call
>
> Whay benchmark is this?

Simple queries output to /dev/null. Use \timing in psql to get times.

First measure the benchmark overhead:

select null::integer from generate_series(1,1000) s1,                         generate_series(1,1000) s2;

Since output functions are strict, this does not call int4out at all, so
this measures the time taken to generate the million rows, output and discard
them.

Then do the real tests:

select 0::integer from generate_series(1,1000) s1,                      generate_series(1,1000) s2;

This calls int4out(0) a million times. (the input function is only called
once since it is a constant, and therefore handled during planning)

select 0::numeric from generate_series(1,1000) s1,                      generate_series(1,1000) s2;

This calls numeric_out(0) a million times. And so on.

-- 
Andrew, Supernews
http://www.supernews.com - individual and corporate NNTP services


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: confusing comment in tqual.c
Следующее
От: Andrew - Supernews
Дата:
Сообщение: Re: New version of money type