Search before asking
Problem Description
Is your feature request related to a problem? Please describe.
The current implementation of getNodeRelationsByLabels method uses full label objects to query node relations, which can cause slow SQL queries when dealing with large datasets. The query performance is suboptimal due to complex label value comparisons.
Description
A short description of your feature
Add a new method getNodeRelationsByLabelIds that accepts label IDs directly instead of full label objects, optimizing the SQL query to use simple ID-based lookups with INNER JOINs.
Use case
Describe the use case of your feature request and the solution you'd like.
This optimization improves query performance significantly when:
- Querying node relations for a large number of labels
- The system has many service instances and labels
- Frequent label-based lookups are required
The new method uses direct ID comparisons which are much faster than label value string comparisons.
Solutions
Describe alternatives you've considered.
- Keep the existing method and optimize the SQL (rejected: requires extensive refactoring)
- Add database indexes (rejected: adds maintenance overhead)
- Add new method with ID-based lookup (accepted: clean and efficient)
Anything else
Additional context or screenshots about the feature request.
This change maintains backward compatibility by keeping the original getNodeRelationsByLabels method intact.
Are you willing to submit a PR?
Search before asking
Problem Description
Is your feature request related to a problem? Please describe.
The current implementation of
getNodeRelationsByLabelsmethod uses full label objects to query node relations, which can cause slow SQL queries when dealing with large datasets. The query performance is suboptimal due to complex label value comparisons.Description
A short description of your feature
Add a new method
getNodeRelationsByLabelIdsthat accepts label IDs directly instead of full label objects, optimizing the SQL query to use simple ID-based lookups with INNER JOINs.Use case
Describe the use case of your feature request and the solution you'd like.
This optimization improves query performance significantly when:
The new method uses direct ID comparisons which are much faster than label value string comparisons.
Solutions
Describe alternatives you've considered.
Anything else
Additional context or screenshots about the feature request.
This change maintains backward compatibility by keeping the original
getNodeRelationsByLabelsmethod intact.Are you willing to submit a PR?