Skip site navigation (1) Skip section navigation (2)

Re: immutable functions vs. join for lookups ?

From: Dawid Kuroczko <qnex42(at)gmail(dot)com>
To: weigelt(at)metux(dot)de, pgsql-performance(at)postgresql(dot)org
Subject: Re: immutable functions vs. join for lookups ?
Date: 2005-04-22 10:08:50
Message-ID: 758d5e7f0504220308453c0dbc@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-performance
On 4/21/05, Enrico Weigelt <weigelt(at)metux(dot)de> wrote:
> * Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> 
> <snip>
> > Yeah, I was actually thinking about a two-step process: inline the
> > function to produce somethig equivalent to a handwritten scalar
> > sub-SELECT, and then try to convert sub-SELECTs into joins.
> 
> ... back to my original question ...
> 
> What kind of query should I use ?
> Is a join better than a function ?

It appears that JOINs are usually faster.  So if performance is an
important issue, go with JOIN (and VIEWs probably).  Functions are nicer
(in terms off look and feel).

   Regards,
     Dawid

In response to

pgsql-performance by date

Next:From: Dawid KuroczkoDate: 2005-04-22 10:15:24
Subject: Re: immutable functions vs. join for lookups ?
Previous:From: Andreas PflugDate: 2005-04-22 09:47:31
Subject: Re: Joel's Performance Issues WAS : Opteron vs Xeon

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group