Re: Mystery function error
| От | Tom Lane |
|---|---|
| Тема | Re: Mystery function error |
| Дата | |
| Msg-id | 9398.1064765182@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: Mystery function error (Josh Berkus <josh@agliodbs.com>) |
| Ответы |
Re: Mystery function error
|
| Список | pgsql-sql |
Josh Berkus <josh@agliodbs.com> writes:
> Also, this will run faster if you do it as a SQL function:
> CREATE FUNCTION locate ( text, text ) RETURNS INT AS '
> SELECT POSITION($2, $1);
> ' LANGUAGE SQL IMMUTABLE STRICT;
This is definitely the solution I'd recommend for 7.4 (because 7.4 would
inline the SQL function definition, resulting in zero runtime overhead).
In 7.3 I suspect the plpgsql version might be a tad faster, or anyway
comparable. Has anyone done any head-to-head performance comparisons
on such simple functions?
regards, tom lane
В списке pgsql-sql по дате отправления: