Project

General

Profile

« Previous | Next » 

Revision 12516

bugfix: *.sql: public.source_by_shortname(): need to wrap it in a nested SELECT because Postgres incorrectly does not constant-fold (inline) it, leading to a slowdown when it is therefore run many times. this is done using the steps at wiki.vegpath.org/Postgres_queries#wrap-function-call-in-nested-SELECT .

View differences:

postprocess.sql
12 12
SELECT DISTINCT dataprovider
13 13
FROM sourcelist
14 14
JOIN provider_count ON provider_count.dataprovider = sourcelist.name
15
WHERE source_id = source_by_shortname('SpeciesLink')
15
WHERE source_id = (SELECT source_by_shortname('SpeciesLink'))
16 16
ORDER BY dataprovider
17 17
*/
18 18
;

Also available in: Unified diff