Re: [HACKERS] memory dilemma - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] memory dilemma
Date
Msg-id 26286.946310966@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] memory dilemma  (Karel Zak - Zakkr <zakkr@zf.jcu.cz>)
Responses Re: [HACKERS] memory dilemma
List pgsql-hackers
Karel Zak - Zakkr <zakkr@zf.jcu.cz> writes:
> *Very* simpl test over 10000 rows:

> $ time psql test -c  "select date_part('second', d)
> from dtest;"  -o /dev/null

> real    0m0.504s
> user    0m0.100s
> sys     0m0.000s

> $ time psql test -c  "select to_char(d, 'SI') from
> dtest;"  -o /dev/null

> real    0m0.288s
> user    0m0.100s
> sys     0m0.000s

That isn't necessarily an impressive demonstration --- what is the data
type of your "d" column?  Four of the six variants of date_part() are
implemented as SQL functions, which naturally adds a lot of overhead...
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] Explain plan output
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] Logfile rotation