sandy-bes commented on code in PR #2351:
URL: https://github.com/apache/age/pull/2351#discussion_r3013703301
##########
src/backend/utils/adt/age_global_graph.c:
##########
@@ -204,43 +204,117 @@ static List *get_ag_labels_names(Snapshot snapshot, Oid
graph_oid,
TableScanDesc scan_desc;
HeapTuple tuple;
TupleDesc tupdesc;
+ Oid index_oid = InvalidOid;
/* we need a valid snapshot */
Assert(snapshot != NULL);
- /* setup scan keys to get all edges for the given graph oid */
- ScanKeyInit(&scan_keys[1], Anum_ag_label_graph, BTEqualStrategyNumber,
- F_OIDEQ, ObjectIdGetDatum(graph_oid));
- ScanKeyInit(&scan_keys[0], Anum_ag_label_kind, BTEqualStrategyNumber,
- F_CHAREQ, CharGetDatum(label_type));
-
/* setup the table to be scanned, ag_label in this case */
ag_label = table_open(ag_label_relation_id(), AccessShareLock);
- scan_desc = table_beginscan(ag_label, snapshot, 2, scan_keys);
/* get the tupdesc - we don't need to release this one */
tupdesc = RelationGetDescr(ag_label);
/* bail if the number of columns differs - this table has 5 */
Assert(tupdesc->natts == Natts_ag_label);
- /* get all of the label names */
- while((tuple = heap_getnext(scan_desc, ForwardScanDirection)) != NULL)
+ /* We look for 'ag_label_graph_oid_index' or any index starting with
'graph' */
Review Comment:
Done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]