pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
date_part vs extract
4+ messages / 4 participants
[nested] [flat]

* date_part vs extract
@ 2001-11-29 08:45 Markus Bertheau <twanger@bluetwanger.de>
  2001-11-29 09:48 ` Re: date_part vs extract Brent Verner <brent@rcfile.org>
  2001-11-29 19:04 ` Re: date_part vs extract Peter Eisentraut <peter_e@gmx.net>
  0 siblings, 2 replies; 4+ messages in thread

From: Markus Bertheau @ 2001-11-29 08:45 UTC (permalink / raw)
  To: pgsql-sql

I wonder about the difference between date_part('week', ...) and
extract(week from ...) not only but also from a performance point of
view. I read extract is standard and date_part is not. Backwards
compatibility maybe justifies the existence of date_part. Whats else?

Markus Bertheau

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: date_part vs extract
  2001-11-29 08:45 date_part vs extract Markus Bertheau <twanger@bluetwanger.de>
@ 2001-11-29 09:48 ` Brent Verner <brent@rcfile.org>
  1 sibling, 0 replies; 4+ messages in thread

From: Brent Verner @ 2001-11-29 09:48 UTC (permalink / raw)
  To: Markus Bertheau <twanger@bluetwanger.de>; +Cc: pgsql-sql

On 29 Nov 2001 at 09:45 (+0100), Markus Bertheau wrote:
| I wonder about the difference between date_part('week', ...) and
| extract(week from ...) not only but also from a performance point of
| view. I read extract is standard and date_part is not. Backwards
| compatibility maybe justifies the existence of date_part. Whats else?

The EXTRACT syntax ends up as a call to the internal date_part(...) 
function.  If SQL-portability is not a concern, calling date_part()
directly should be a bit quicker.

cheers.
  brent


-- 
"Develop your talent, man, and leave the world something. Records are 
really gifts from people. To think that an artist would love you enough
to share his music with anyone is a beautiful thing."  -- Duane Allman



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: date_part vs extract
  2001-11-29 08:45 date_part vs extract Markus Bertheau <twanger@bluetwanger.de>
@ 2001-11-29 19:04 ` Peter Eisentraut <peter_e@gmx.net>
  2001-11-29 19:14   ` Re: date_part vs extract Bruce Momjian <pgman@candle.pha.pa.us>
  1 sibling, 1 reply; 4+ messages in thread

From: Peter Eisentraut @ 2001-11-29 19:04 UTC (permalink / raw)
  To: Markus Bertheau <twanger@bluetwanger.de>; +Cc: pgsql-sql

Markus Bertheau writes:

> I wonder about the difference between date_part('week', ...) and
> extract(week from ...) not only but also from a performance point of
> view. I read extract is standard and date_part is not. Backwards
> compatibility maybe justifies the existence of date_part. Whats else?

I think date_part() was adapted from Ingres.  Btw., note that the "week"
parameter (and most others) aren't standard either.

-- 
Peter Eisentraut   peter_e@gmx.net




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: date_part vs extract
  2001-11-29 08:45 date_part vs extract Markus Bertheau <twanger@bluetwanger.de>
  2001-11-29 19:04 ` Re: date_part vs extract Peter Eisentraut <peter_e@gmx.net>
@ 2001-11-29 19:14   ` Bruce Momjian <pgman@candle.pha.pa.us>
  0 siblings, 0 replies; 4+ messages in thread

From: Bruce Momjian @ 2001-11-29 19:14 UTC (permalink / raw)
  To: Peter Eisentraut <peter_e@gmx.net>; +Cc: Markus Bertheau <twanger@bluetwanger.de>; pgsql-sql

> Markus Bertheau writes:
> 
> > I wonder about the difference between date_part('week', ...) and
> > extract(week from ...) not only but also from a performance point of
> > view. I read extract is standard and date_part is not. Backwards
> > compatibility maybe justifies the existence of date_part. Whats else?
> 
> I think date_part() was adapted from Ingres.  Btw., note that the "week"
> parameter (and most others) aren't standard either.

Yes, from Ingres.  I think Thomas added it.  Both he and I have Ingres
experience.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2001-11-29 19:14 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-11-29 08:45 date_part vs extract Markus Bertheau <twanger@bluetwanger.de>
2001-11-29 09:48 ` Brent Verner <brent@rcfile.org>
2001-11-29 19:04 ` Peter Eisentraut <peter_e@gmx.net>
2001-11-29 19:14   ` Bruce Momjian <pgman@candle.pha.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox