[v10.1.x] Search v1: Remove unnecessary subqueries (#72710)

Search v1: Remove unnecessary subqueries (#72388)

* Add feature flag

* Introduce interface and dummy implementation

* Add tests for the new filter

* accessControlDashboardPermissionFilterNoFolderSubquery implementation

* join only if it's necessary

* force ordering for tests

* Temporarily enable new query for benchmarks

(cherry picked from commit 2c26a02b82)

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
This commit is contained in:
grafana-delivery-bot[bot]
2023-08-03 11:12:14 +03:00
committed by GitHub
co-authored by Sofia Papagiannaki
parent d7a65cb7ca
commit 5769d0be49
15 changed files with 516 additions and 157 deletions
+4 -1
View File
@@ -99,7 +99,10 @@ func (b *Builder) applyFilters() (ordering string) {
for _, f := range b.Filters {
if f, ok := f.(FilterLeftJoin); ok {
joins = append(joins, fmt.Sprintf(" LEFT OUTER JOIN %s ", f.LeftJoin()))
s := f.LeftJoin()
if s != "" {
joins = append(joins, fmt.Sprintf(" LEFT OUTER JOIN %s ", s))
}
}
if f, ok := f.(FilterWhere); ok {