Re: [BUGS] BUG #14464: Problems about FUNCTIONS - Mailing list pgsql-bugs

From David G. Johnston
Subject Re: [BUGS] BUG #14464: Problems about FUNCTIONS
Date
Msg-id CAKFQuwbm7=hsuu2fH_j+nMC_Yh4KCtbz9ODDhmBhJ1hA6Dp7cA@mail.gmail.com
Whole thread Raw
In response to [BUGS] BUG #14464: Problems about FUNCTIONS  (syspegasus@gmail.com)
List pgsql-bugs
On Tue, Dec 13, 2016 at 9:42 AM, <syspegasus@gmail.com> wrote:
The following bug has been logged on the website:

Bug reference:      14464

Hi, I'm with problems about functions.
When I execute a select with Function is very slow, and when I execute
repeating the code of the existing function inside my SQL is faster.
I need to centralize my code, because of that I'm using functions, but is
very very slow..
Please how can I use Function and become faster? I need to centralize the
SQL

This list is intended for reporting bugs in PostgreSQL.  This request for help is not that.  Please choose a more appropriate list - pgsql-general@postgresql.org suffices as a catch-all.

​That said, you'll likely find improvement by choosing the correct language to write your function in.  Namely, choose SQL unless and until you are forced to choose pl/pgsql.  As you are simply embedding a single SELECT query you do not use any features that are only present in pl/pgsql.

David J.

pgsql-bugs by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: [BUGS] BUG #14463: refcursor cann't used with array or variadic parameter?
Next
From: Tom Lane
Date:
Subject: Re: [BUGS] BUG #14463: refcursor cann't used with array or variadic parameter?