Revision 6086
Added by Aaron Marcuse-Kubitza about 12 years ago
schemas/vegbien.my.sql | ||
---|---|---|
333 | 333 |
|
334 | 334 |
|
335 | 335 |
-- |
336 |
-- Name: reference_by_shortname(text); Type: FUNCTION; Schema: public; Owner: - |
|
337 |
-- |
|
338 |
|
|
339 |
|
|
340 |
|
|
341 |
|
|
342 |
-- |
|
336 | 343 |
-- Name: sync_analytical_aggregate_to_view(); Type: FUNCTION; Schema: public; Owner: - |
337 | 344 |
-- |
338 | 345 |
|
schemas/vegbien.sql | ||
---|---|---|
758 | 758 |
|
759 | 759 |
|
760 | 760 |
-- |
761 |
-- Name: reference_by_shortname(text); Type: FUNCTION; Schema: public; Owner: - |
|
762 |
-- |
|
763 |
|
|
764 |
CREATE FUNCTION reference_by_shortname(shortname text) RETURNS integer |
|
765 |
LANGUAGE sql STABLE STRICT |
|
766 |
AS $$ |
|
767 |
SELECT reference_id FROM reference WHERE reference.shortname = shortname LIMIT 1 |
|
768 |
$$; |
|
769 |
|
|
770 |
|
|
771 |
-- |
|
761 | 772 |
-- Name: sync_analytical_aggregate_to_view(); Type: FUNCTION; Schema: public; Owner: - |
762 | 773 |
-- |
763 | 774 |
|
Also available in: Unified diff
schemas/vegbien.sql: Added reference_by_shortname(). Using this function instead of the manual query should force the query planner to evaluate this expression first, rather than complexly reordering joins to place this nested select as a filter condition.