Project

General

Profile

« Previous | Next » 

Revision 5296

schemas/vegbien.sql: taxonconcept: Merged taxonconcept_unique_within_creator_by_name unique index into taxonconcept_unique_within_parent, placed parent_id first, and removed index condition, so that this index can be used as a lookup index by taxonconcept_update_ancestors() (which requires no index condition in order to apply to all taxonconcepts) in addition to as a unique index. Note that an index condition should not be necessary for the index's uniquifying task, because if a set of taxonconcepts provides only the identifyingtaxonomicname, that should collide in the taxonconcept_unique_within_creator_by_identifying_name unique index before this index collides. This assumes that the collision order when multiple indexes collide is alphabetical by the index name.

View differences:

schemas/vegbien.my.sql
3976 3976

  
3977 3977

  
3978 3978
--
3979
-- Name: taxonconcept_unique_within_creator_by_name; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3980
--
3981

  
3982

  
3983

  
3984

  
3985
--
3986 3979
-- Name: taxonconcept_unique_within_parent; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3987 3980
--
3988 3981

  
schemas/vegbien.sql
4624 4624

  
4625 4625

  
4626 4626
--
4627
-- Name: taxonconcept_unique_within_creator_by_name; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4628
--
4629

  
4630
CREATE UNIQUE INDEX taxonconcept_unique_within_creator_by_name ON taxonconcept USING btree (creator_id, (COALESCE(taxonomicname, '\\N'::text)), (COALESCE(author, '\\N'::text)), (COALESCE(taxonomicnamewithauthor, '\\N'::text)), (COALESCE(domain, '\\N'::text)), (COALESCE(kingdom, '\\N'::text)), (COALESCE(phylum, '\\N'::text)), (COALESCE(class, '\\N'::text)), (COALESCE("order", '\\N'::text)), (COALESCE(family, '\\N'::text)), (COALESCE(genus, '\\N'::text)), (COALESCE(species, '\\N'::text)), (COALESCE(subspecies, '\\N'::text)), (COALESCE(variety, '\\N'::text)), (COALESCE(forma, '\\N'::text)), (COALESCE(cultivar, '\\N'::text)), (COALESCE(taxonname, '\\N'::text))) WHERE ((identifyingtaxonomicname IS NULL) AND ((taxonname IS NULL) OR (parent_id IS NULL)));
4631

  
4632

  
4633
--
4634 4627
-- Name: taxonconcept_unique_within_parent; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4635 4628
--
4636 4629

  
4637
CREATE UNIQUE INDEX taxonconcept_unique_within_parent ON taxonconcept USING btree ((COALESCE(taxonname, '\\N'::text)), (COALESCE(rank, 'unknown'::taxonrank)), (COALESCE(parent_id, 2147483647))) WHERE (((identifyingtaxonomicname IS NULL) AND (taxonname IS NOT NULL)) AND (parent_id IS NOT NULL));
4630
CREATE UNIQUE INDEX taxonconcept_unique_within_parent ON taxonconcept USING btree ((COALESCE(parent_id, 2147483647)), (COALESCE(taxonname, '\\N'::text)), (COALESCE(rank, 'unknown'::taxonrank)), creator_id, (COALESCE(identifyingtaxonomicname, '\\N'::text)), (COALESCE(taxonomicname, '\\N'::text)), (COALESCE(author, '\\N'::text)), (COALESCE(taxonomicnamewithauthor, '\\N'::text)), (COALESCE(domain, '\\N'::text)), (COALESCE(kingdom, '\\N'::text)), (COALESCE(phylum, '\\N'::text)), (COALESCE(class, '\\N'::text)), (COALESCE("order", '\\N'::text)), (COALESCE(family, '\\N'::text)), (COALESCE(genus, '\\N'::text)), (COALESCE(species, '\\N'::text)), (COALESCE(subspecies, '\\N'::text)), (COALESCE(variety, '\\N'::text)), (COALESCE(forma, '\\N'::text)), (COALESCE(cultivar, '\\N'::text)));
4638 4631

  
4639 4632

  
4640 4633
--

Also available in: Unified diff