\set ECHO all
\timing on

-- date

select date_part('day', current_date + generate_series(0, 10000000) * interval '1 day') \g /dev/null
select date_part('month', current_date + generate_series(0, 10000000) * interval '1 day') \g /dev/null
select date_part('quarter', current_date + generate_series(0, 10000000) * interval '1 day') \g /dev/null
select date_part('week', current_date + generate_series(0, 10000000) * interval '1 day') \g /dev/null
select date_part('year', current_date + generate_series(0, 10000000) * interval '1 day') \g /dev/null
select date_part('decade', current_date + generate_series(0, 10000000) * interval '1 day') \g /dev/null
select date_part('century', current_date + generate_series(0, 10000000) * interval '1 day') \g /dev/null
select date_part('millennium', current_date + generate_series(0, 10000000) * interval '1 day') \g /dev/null
select date_part('julian', current_date + generate_series(0, 10000000) * interval '1 day') \g /dev/null
select date_part('isoyear', current_date + generate_series(0, 10000000) * interval '1 day') \g /dev/null
select date_part('dow', current_date + generate_series(0, 10000000) * interval '1 day') \g /dev/null
select date_part('isodow', current_date + generate_series(0, 10000000) * interval '1 day') \g /dev/null
select date_part('doy', current_date + generate_series(0, 10000000) * interval '1 day') \g /dev/null
select date_part('epoch', current_date + generate_series(0, 10000000) * interval '1 day') \g /dev/null

select extract(day from current_date + generate_series(0, 10000000) * interval '1 day') \g /dev/null
select extract(month from current_date + generate_series(0, 10000000) * interval '1 day') \g /dev/null
select extract(quarter from current_date + generate_series(0, 10000000) * interval '1 day') \g /dev/null
select extract(week from current_date + generate_series(0, 10000000) * interval '1 day') \g /dev/null
select extract(year from current_date + generate_series(0, 10000000) * interval '1 day') \g /dev/null
select extract(decade from current_date + generate_series(0, 10000000) * interval '1 day') \g /dev/null
select extract(century from current_date + generate_series(0, 10000000) * interval '1 day') \g /dev/null
select extract(millennium from current_date + generate_series(0, 10000000) * interval '1 day') \g /dev/null
select extract(julian from current_date + generate_series(0, 10000000) * interval '1 day') \g /dev/null
select extract(isoyear from current_date + generate_series(0, 10000000) * interval '1 day') \g /dev/null
select extract(dow from current_date + generate_series(0, 10000000) * interval '1 day') \g /dev/null
select extract(isodow from current_date + generate_series(0, 10000000) * interval '1 day') \g /dev/null
select extract(doy from current_date + generate_series(0, 10000000) * interval '1 day') \g /dev/null
select extract(epoch from current_date + generate_series(0, 10000000) * interval '1 day') \g /dev/null

-- time

select date_part('microseconds', localtime + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select date_part('milliseconds', localtime + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select date_part('second', localtime + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select date_part('minute', localtime + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select date_part('hour', localtime + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select date_part('epoch', localtime + generate_series(0, 10000000) * interval '1 second') \g /dev/null

select extract(microseconds from localtime + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select extract(milliseconds from localtime + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select extract(second from localtime + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select extract(minute from localtime + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select extract(hour from localtime + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select extract(epoch from localtime + generate_series(0, 10000000) * interval '1 second') \g /dev/null

-- timetz

select date_part('microseconds', current_time + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select date_part('milliseconds', current_time + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select date_part('second', current_time + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select date_part('minute', current_time + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select date_part('hour', current_time + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select date_part('timezone_minute', current_time + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select date_part('timezone_hour', current_time + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select date_part('epoch', current_time + generate_series(0, 10000000) * interval '1 second') \g /dev/null

select extract(microseconds from current_time + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select extract(milliseconds from current_time + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select extract(second from current_time + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select extract(minute from current_time + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select extract(hour from current_time + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select extract(timezone_minute from current_time + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select extract(timezone_hour from current_time + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select extract(epoch from current_time + generate_series(0, 10000000) * interval '1 second') \g /dev/null

-- timestamp

select date_part('microseconds', localtimestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select date_part('milliseconds', localtimestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select date_part('second', localtimestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select date_part('minute', localtimestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select date_part('hour', localtimestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select date_part('day', localtimestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select date_part('month', localtimestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select date_part('quarter', localtimestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select date_part('week', localtimestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select date_part('year', localtimestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select date_part('decade', localtimestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select date_part('century', localtimestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select date_part('millennium', localtimestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select date_part('julian', localtimestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select date_part('isoyear', localtimestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select date_part('dow', localtimestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select date_part('isodow', localtimestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select date_part('doy', localtimestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select date_part('epoch', localtimestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null

select extract(microseconds from localtimestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select extract(milliseconds from localtimestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select extract(second from localtimestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select extract(minute from localtimestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select extract(hour from localtimestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select extract(day from localtimestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select extract(month from localtimestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select extract(quarter from localtimestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select extract(week from localtimestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select extract(year from localtimestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select extract(decade from localtimestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select extract(century from localtimestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select extract(millennium from localtimestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select extract(julian from localtimestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select extract(isoyear from localtimestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select extract(dow from localtimestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select extract(isodow from localtimestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select extract(doy from localtimestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select extract(epoch from localtimestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null

-- timestamptz

select date_part('microseconds', current_timestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select date_part('milliseconds', current_timestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select date_part('second', current_timestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select date_part('minute', current_timestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select date_part('hour', current_timestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select date_part('day', current_timestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select date_part('month', current_timestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select date_part('quarter', current_timestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select date_part('week', current_timestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select date_part('year', current_timestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select date_part('decade', current_timestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select date_part('century', current_timestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select date_part('millennium', current_timestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select date_part('julian', current_timestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select date_part('isoyear', current_timestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select date_part('dow', current_timestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select date_part('isodow', current_timestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select date_part('doy', current_timestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select date_part('timezone_minute', current_timestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select date_part('timezone_hour', current_timestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select date_part('epoch', current_timestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null

select extract(microseconds from current_timestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select extract(milliseconds from current_timestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select extract(second from current_timestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select extract(minute from current_timestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select extract(hour from current_timestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select extract(day from current_timestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select extract(month from current_timestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select extract(quarter from current_timestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select extract(week from current_timestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select extract(year from current_timestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select extract(decade from current_timestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select extract(century from current_timestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select extract(millennium from current_timestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select extract(julian from current_timestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select extract(isoyear from current_timestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select extract(dow from current_timestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select extract(isodow from current_timestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select extract(doy from current_timestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select extract(timezone_minute from current_timestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select extract(timezone_hour from current_timestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null
select extract(epoch from current_timestamp + generate_series(0, 10000000) * interval '1 second') \g /dev/null

-- interval

select date_part('microseconds', generate_series(0, 10000000) * interval '1 second') \g /dev/null
select date_part('milliseconds', generate_series(0, 10000000) * interval '1 second') \g /dev/null
select date_part('second', generate_series(0, 10000000) * interval '1 second') \g /dev/null
select date_part('minute', generate_series(0, 10000000) * interval '1 second') \g /dev/null
select date_part('hour', generate_series(0, 10000000) * interval '1 second') \g /dev/null
select date_part('day', generate_series(0, 10000000) * interval '1 second') \g /dev/null
select date_part('month', generate_series(0, 10000000) * interval '1 second') \g /dev/null
select date_part('quarter', generate_series(0, 10000000) * interval '1 second') \g /dev/null
select date_part('year', generate_series(0, 10000000) * interval '1 second') \g /dev/null
select date_part('decade', generate_series(0, 10000000) * interval '1 second') \g /dev/null
select date_part('century', generate_series(0, 10000000) * interval '1 second') \g /dev/null
select date_part('millennium', generate_series(0, 10000000) * interval '1 second') \g /dev/null
select date_part('epoch', generate_series(0, 10000000) * interval '1 second') \g /dev/null

select extract(microseconds from generate_series(0, 10000000) * interval '1 second') \g /dev/null
select extract(milliseconds from generate_series(0, 10000000) * interval '1 second') \g /dev/null
select extract(second from generate_series(0, 10000000) * interval '1 second') \g /dev/null
select extract(minute from generate_series(0, 10000000) * interval '1 second') \g /dev/null
select extract(hour from generate_series(0, 10000000) * interval '1 second') \g /dev/null
select extract(day from generate_series(0, 10000000) * interval '1 second') \g /dev/null
select extract(month from generate_series(0, 10000000) * interval '1 second') \g /dev/null
select extract(quarter from generate_series(0, 10000000) * interval '1 second') \g /dev/null
select extract(year from generate_series(0, 10000000) * interval '1 second') \g /dev/null
select extract(decade from generate_series(0, 10000000) * interval '1 second') \g /dev/null
select extract(century from generate_series(0, 10000000) * interval '1 second') \g /dev/null
select extract(millennium from generate_series(0, 10000000) * interval '1 second') \g /dev/null
select extract(epoch from generate_series(0, 10000000) * interval '1 second') \g /dev/null
