Merge pull request #8864 from RoadieHQ/query-perf-tweaks-for-tech-insights
[TechInsights] Modify queries to perform better by filtering on subqueries as well
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-tech-insights-backend': patch
|
||||
---
|
||||
|
||||
Modify queries to perform better by filtering on sub-queries as well
|
||||
@@ -112,6 +112,8 @@ export class TechInsightsDatabase implements TechInsightsStore {
|
||||
this.db('facts')
|
||||
.max('timestamp')
|
||||
.column('id as subId')
|
||||
.where({ entity: entityTriplet })
|
||||
.and.whereIn('id', ids)
|
||||
.groupBy('id')
|
||||
.as('subQ'),
|
||||
'facts.id',
|
||||
|
||||
Reference in New Issue
Block a user