Project

General

Profile

1
SELECT util.search_path_append('util');
2

    
3
SELECT create_if_not_exists($$CREATE INDEX raw_occurrence_record_plants_institution_code ON raw_occurrence_record_plants ("specimenHolderInstitutions")$$);
4

    
5
-- Remove institutions that we have direct data for
6
-- rerun time: ~0 ("Time: 4.924 ms") thanks to index
7
DELETE FROM :table
8
WHERE "specimenHolderInstitutions" IN (
9
      'ACAD'
10
    , 'ARIZ'
11
    , 'BRIT'
12
    , 'MO'
13
    , 'MT'
14
    , 'NY'
15
    , 'QFA'
16
    , 'TEX'
17
    , 'TRT'
18
    , 'TRTE'
19
    , 'U'
20
    , 'UBC'
21
    , 'WIN'
22
)
23
/* list obtained using the following on r9459:
24
SELECT DISTINCT dataprovider
25
FROM sourcelist
26
JOIN provider_count ON provider_count.dataprovider = sourcelist.name
27
WHERE source_id = source_by_shortname('GBIF')
28
ORDER BY dataprovider
29
*/
30
;
(6-6/9)