Project

General

Profile

1 5183 aaronmk
CREATE TABLE tnrs
2 5110 aaronmk
(
3 5737 aaronmk
  "Time_submitted" timestamp with time zone,
4 5110 aaronmk
  "Name_number" text,
5
  "Name_submitted" text NOT NULL,
6
  "Overall_score" text,
7
  "Name_matched" text,
8
  "Name_matched_rank" text,
9
  "Name_score" text,
10
  "Name_matched_author" text,
11
  "Name_matched_url" text,
12
  "Author_matched" text,
13
  "Author_score" text,
14
  "Family_matched" text,
15
  "Family_score" text,
16
  "Name_matched_accepted_family" text,
17
  "Genus_matched" text,
18
  "Genus_score" text,
19
  "Specific_epithet_matched" text,
20
  "Specific_epithet_score" text,
21
  "Infraspecific_rank" text,
22
  "Infraspecific_epithet_matched" text,
23
  "Infraspecific_epithet_score" text,
24
  "Infraspecific_rank_2" text,
25
  "Infraspecific_epithet_2_matched" text,
26
  "Infraspecific_epithet_2_score" text,
27
  "Annotations" text,
28
  "Unmatched_terms" text,
29
  "Taxonomic_status" text,
30
  "Accepted_name" text,
31
  "Accepted_name_author" text,
32
  "Accepted_name_rank" text,
33
  "Accepted_name_url" text,
34
  "Accepted_name_species" text,
35
  "Accepted_name_family" text,
36
  "Selected" text,
37
  "Source" text,
38
  "Warnings" text,
39
  "Accepted_name_lsid" text,
40
  CONSTRAINT tnrs_pkey PRIMARY KEY ("Name_submitted" )
41
)
42
WITH (
43
  OIDS=FALSE
44
);
45 5526 aaronmk
COMMENT ON TABLE "TNRS".tnrs
46
  IS 'tnrs_accepted_names sorts accepted names first (note that false sorts before true). Accepted names are defined as names that scrub to themselves.
47 5185 aaronmk
48 5526 aaronmk
Accepted names must be processed before any names that resolve to them, because the entry for the accepted name contains all the ranks parsed out but the resolved name of another entry contains just some ranks and the taxonomic name. Column-based import will do this automatically when the total # of rows is <= the partition_size (because _taxonconcept_set_matched_concept_id()''s accepted taxonconcept is created after the main taxonconcept), but TNRS has more rows than this so sorting is needed to ensure that all the accepted names are processed in the first partitions.';
49
50 5185 aaronmk
CREATE INDEX tnrs_accepted_names
51
  ON tnrs
52
  USING btree
53
  ((NOT "Name_submitted" = ("Accepted_name" || COALESCE(' '::text || "Accepted_name_author", ''::text))) , "Name_submitted" );
54
ALTER TABLE tnrs CLUSTER ON tnrs_accepted_names;