Here's a new view for higher taxonomy, called element_global_tax_search_vw. It replicates what the original element_global_tax_vw does, but it's more flexible.

The user can join to it by element_global_id, and it gives all of the higher taxonomy for that element. So the user can either return higher tax for an element, or limit their query by higher taxonomy (e.g. WHERE family = 'Alcidae'). The original view was optimized for the former, but impossibly slow at the latter.

Unfortunately, this only works for botany & zoology elements right now-- community elements won't appear in the view results.

CREATE OR REPLACE VIEW element_global_tax_search_vw
AS
SELECT egt.element_global_id,
gname.scientific_name gname,
genus.higher_class_unit_name genus,
family.higher_class_unit_name family,
taxorder.higher_class_unit_name taxorder,
taxclass.higher_class_unit_name taxclass,
phylum.higher_class_unit_name phylum,
kingdom.higher_class_unit_name kingdom,
element_global_seq_uid,
element_global_ou_uid
FROM element_global egt,
scientific_name gname,
d_name_category dnc,
higher_class_unit genus,
higher_class_unit family,
higher_class_unit taxorder,
higher_class_unit taxclass,
higher_class_unit phylum,
higher_class_unit kingdom
WHERE egt.higher_class_unit_id = genus.higher_class_unit_id
and egt.gname_id = gname.scientific_name_id
and gname.d_name_category_id = dnc.d_name_category_id
and genus.parent_unit_id = family.higher_class_unit_id
and family.parent_unit_id = taxorder.higher_class_unit_id
and taxorder.parent_unit_id = taxclass.higher_class_unit_id
and taxclass.parent_unit_id = phylum.higher_class_unit_id
and phylum.parent_unit_id = kingdom.higher_class_unit_id
and dnc.name_type_cd <> 'C';