@@ -107,8 +107,8 @@ create table if not exists node
107107alter table node
108108 alter column properties set storage main;
109109
110- -- Index on the graph ID of each node .
111- create index if not exists node_graph_id_index on node using btree (graph_id) ;
110+ -- Remove the old graph ID index .
111+ drop index if exists node_graph_id_index;
112112
113113-- Index node kind IDs so that lookups by kind is accelerated.
114114create index if not exists node_kind_ids_index on node using gin (kind_ids);
@@ -176,8 +176,8 @@ execute procedure delete_node_edges();
176176alter table edge
177177 alter column properties set storage main;
178178
179- -- Index on the graph ID of each edge .
180- create index if not exists edge_graph_id_index on edge using btree (graph_id) ;
179+ -- Remove the old graph ID index .
180+ drop index if exists edge_graph_id_index;
181181
182182-- Index on the start vertex of each edge.
183183create index if not exists edge_start_id_index on edge using btree (start_id);
@@ -188,6 +188,11 @@ create index if not exists edge_end_id_index on edge using btree (end_id);
188188-- Index on the kind of each edge.
189189create index if not exists edge_kind_index on edge using btree (kind_id);
190190
191+ -- Index lookups that include the edge's start or end id along with a filter for the edge type. This is the most
192+ -- common join filter during traversal.
193+ create index if not exists edge_start_kind_index on edge using btree (start_id, kind_id);
194+ create index if not exists edge_end_kind_index on edge using btree (end_id, kind_id);
195+
191196-- Path composite type
192197do
193198$$
0 commit comments