@@ -1299,16 +1299,18 @@ def create_node_indexes(nodes: VertexCollection) -> None:
12991299 # old update node index: remove if still exists
13001300 if "update_nodes_ref_id" in node_idxes :
13011301 nodes .delete_index ("update_nodes_ref_id" )
1302+ if "update_nodes" in node_idxes :
1303+ log .info (f"Remove index update_nodes on { nodes .name } " )
1304+ nodes .delete_index ("update_nodes" )
13021305
13031306 # this index will hold all the necessary data to query for an update (index only query)
1304- if "update_nodes " not in node_idxes :
1305- log .info (f"Add index update_nodes on { nodes .name } " )
1307+ if "update_replace_nodes " not in node_idxes :
1308+ log .info (f"Add index update_replace_nodes on { nodes .name } " )
13061309 nodes .add_persistent_index (
1307- # if _key was defined as first property, the optimizer would use it in case
1308- # a simple id() query would be executed.
1309- ["refs.cloud_id" , "refs.account_id" , "refs.region_id" , "hash" , "hist_hash" , "created" , "_key" ],
1310+ ["refs.account_id" , "refs.cloud_id" ],
1311+ storedValues = ["_key" , "hash" , "hist_hash" , "created" ],
13101312 sparse = False ,
1311- name = "update_nodes " ,
1313+ name = "update_replace_nodes " ,
13121314 )
13131315
13141316 if "kinds_id_name_ctime" not in node_idxes :
@@ -1352,13 +1354,19 @@ def create_update_collection_indexes(progress: StandardCollection, node_history:
13521354
13531355 def create_update_edge_indexes (edges : EdgeCollection ) -> None :
13541356 edge_idxes = {idx ["name" ]: idx for idx in cast (List [Json ], edges .indexes ())}
1357+ # delete old index
1358+ if "update_edges_ref_id" in edge_idxes :
1359+ log .info (f"Remove index update_edges_ref_id on { edges .name } " )
1360+ edges .delete_index ("update_edges_ref_id" )
1361+
13551362 # this index will hold all the necessary data to query for an update (index only query)
1356- if "update_edges_ref_id " not in edge_idxes :
1357- log .info (f"Add index update_edges_ref_id on { edges .name } " )
1363+ if "update_edges_replace_nodes " not in edge_idxes :
1364+ log .info (f"Add index update_edges_replace_nodes on { edges .name } " )
13581365 edges .add_persistent_index (
1359- ["_key" , "_from" , "_to" , "refs.cloud_id" , "refs.account_id" , "refs.region_id" ],
1366+ ["refs.account_id" , "refs.cloud_id" ],
1367+ storedValues = ["_key" , "_from" , "_to" ],
13601368 sparse = False ,
1361- name = "update_edges_ref_id " ,
1369+ name = "update_edges_replace_nodes " ,
13621370 )
13631371 outer_edge_ts_index_name = "outer_edge_timestamp_index"
13641372 if outer_edge_ts_index_name not in edge_idxes :
0 commit comments