Re: Why performance improvement on converting subselect to a function ? - Mailing list pgsql-performance

From Tom Lane
Subject Re: Why performance improvement on converting subselect to a function ?
Date
Msg-id 4578.1059514334@sss.pgh.pa.us
Whole thread Raw
In response to Re: Why performance improvement on converting subselect  (Rajesh Kumar Mallah <mallah@trade-india.com>)
Responses Re: Why performance improvement on converting subselect to a function ?
List pgsql-performance
Rajesh Kumar Mallah <mallah@trade-india.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

pgsql-performance by date:

Previous
From: Ron Johnson
Date:
Subject: Re: Tuning PostgreSQL
Next
From: Rajesh Kumar Mallah
Date:
Subject: Re: Why performance improvement on converting subselect to a function ?