 DROP INDEX IF EXISTS tree_simple_name_index;
 DROP INDEX IF EXISTS tree_name_path_index;
 DROP INDEX IF EXISTS tree_tree_path_index;
+DROP INDEX IF EXISTS instance_path_index;
 DROP INDEX IF EXISTS tree_synonyms_index;
 DROP INDEX IF EXISTS tree_version_element_element_index;
 DROP INDEX IF EXISTS tree_version_element_version_index;

     n.simple_name                                                                             AS simple_name,
     coalesce(n.name_element, '?')                                                             AS name_element,
     ipath.instance_path                                                                       AS tree_path,
     regexp_replace(ipath.instance_path, 'x', '', 'g')                                         AS instance_path,
     ipath.name_path                                                                           AS name_path,
     ipath.depth                                                                               AS depth,
     'APNI'                                                                                    AS source_shard,

    n.simple_name :: TEXT                                            AS simple_name,
    coalesce(n.name_element,
             '?')                                                    AS name_path,
    CASE
    WHEN (node.type_uri_id_part = 'ApcConcept')
      THEN
        node.instance_id :: TEXT
    WHEN (node.type_uri_id_part = 'DeclaredBt')
      THEN
        'b' || node.instance_id :: TEXT
    ELSE
      'x' || node.instance_id :: TEXT
    END                                                              AS instance_path,
    ''                                                               AS parent_instance_path,
    FALSE                                                            AS parent_excluded,
