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
This commit is contained in:
Sofia Papagiannaki
2023-08-02 10:39:25 +03:00
committed by GitHub
parent 4ad7aed096
commit 2c26a02b82
15 changed files with 500 additions and 149 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 {