Re: Does it make sense to break a large query into separate functions? - Mailing list pgsql-general

From Tom Lane
Subject Re: Does it make sense to break a large query into separate functions?
Date
Msg-id 21958.1368021917@sss.pgh.pa.us
Whole thread Raw
In response to Does it make sense to break a large query into separate functions?  (Seref Arikan <serefarikan@kurumsalteknoloji.com>)
Responses Re: Does it make sense to break a large query into separate functions?  (Seref Arikan <serefarikan@kurumsalteknoloji.com>)
Re: Does it make sense to break a large query into separate functions?  (Merlin Moncure <mmoncure@gmail.com>)
List pgsql-general
Seref Arikan <serefarikan@kurumsalteknoloji.com> writes:
> I've just noticed that some parts of the autogenerated queries can be
> functions on their own. Would moving these parts to their own functions
> help the query planner?

It's difficult to answer that without a lot more detail than you've
provided, but my offhand guess would be "no".  Usually it's better
when the planner can expand functions inline, which would just be
reversing the transformation you're thinking of.

            regards, tom lane


pgsql-general by date:

Previous
From: Albe Laurenz
Date:
Subject: Re: question on most efficient way to increment a column
Next
From: Seref Arikan
Date:
Subject: Re: Does it make sense to break a large query into separate functions?