Re: Why performance improvement on converting subselect to a function ?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Rajesh Kumar Mallah <mallah(at)trade-india(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Why performance improvement on converting subselect to a function ?
Date: 2003-07-29 21:32:14
Message-ID: 4578.1059514334@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Rajesh Kumar Mallah <mallah(at)trade-india(dot)com> writes:
> Tom Lane wrote:
>> Odd. Apparently the planner is picking a better plan in the function
>> context than in the subselect context --- which is strange since it
>> ought to have less information.

> [ verbose plan snipped ]

Well, that sure seems to be the same plan. Curious that the runtime
wasn't about the same. Perhaps the slow execution of the first query
was a caching effect? If you alternate trying the query both ways,
does the speed difference persist?

regards, tom lane

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Mark Bronnimann 2003-07-30 02:08:59 function returning setof performance question
Previous Message Ron Johnson 2003-07-29 20:38:35 Re: Tuning PostgreSQL