PostgreSQL: Enhancements in 7.4: Performance: Inlining of simple SQL functions

  • Basic SQL functions expanded into outer query
  • By-pass function handling framework
  • Example:
01 CREATE FUNCTION prepid(int) RETURNS text AS '
02 	 SELECT ''USER-'' || $1::text;'
03 LANGUAGE 'SQL';
05
06 SELECT prepid(usrid) as user,email from users;
07
08 SELECT 'USER' || usrid as user,email from users;
Prev

Next

Page 19