Re: Since '2001-09-09 01:46:40'::timestamp microseconds are lost when extracting epoch

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: Since '2001-09-09 01:46:40'::timestamp microseconds are lost when extracting epoch
Дата
Msg-id be30c07c-3f7b-7c86-f1c5-d0858046b26f@2ndquadrant.com
обсуждение исходный текст
Ответ на Re: Since '2001-09-09 01:46:40'::timestamp microseconds are lost when extracting epoch  (Pavel Stehule <pavel.stehule@gmail.com>)
Ответы Re: Since '2001-09-09 01:46:40'::timestamp microseconds are lost when extracting epoch  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Here is a new patch series version.

I have created a new internal function for converting integers to 
numeric, to make the implementation a bit more elegant and compact.

I have also created a new date_part(..., date) in C, and added more test 
coverage for that.

Other than some of the semantic issues mentioned in the previous 
message, this version looks pretty good to me in principle.

I have done some performance tests to assess the impact of changing from 
float to numeric.  I did tests like this:

create table t1 (a int, b timestamp with time zone);
insert into t1 select generate_series(1, 10000000), current_timestamp + 
random() * interval '1000 days';

select extract(dow from b) from t1 \g /dev/null
select extract(epoch from b) from t1 \g /dev/null

There appears to be about a 20% increase in run time for these tests. 
These are obviously extreme tests, so I think that would be okay.  More 
tests and testing ideas are welcome.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Вложения

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

Предыдущее
От: Masahiko Sawada
Дата:
Сообщение: Re: SyncRepLock acquired exclusively in default configuration
Следующее
От: Peter Eisentraut
Дата:
Сообщение: remove some ancient port hacks