Rules Engine "Many-To-One Filter" Dynamic Filter Expression improvements

Description

Currently a Left join with a subquery in combination with a where clause filter is used for this filter.
This is not optimal as via the extra join the query result set is manipulated and not just filtered, requiring a distinct to get rid of duplicates.
Proposal: use exists filter instead.

Example:
Current:
select distinct
testplatform.identifier,
testplatform.name,
testplatform.description,
testplatform.id as id
from
`pobj_testplatform` `testplatform`
left join
(
select
`organisation`.`id` as id
from
`pobj_organisation` `organisation`
where
( organisation.active = true )
) `manyToOneFilterbcccebd00bc54d8da500be59e9ef0b9e`
on (`manyToOneFilterbcccebd00bc54d8da500be59e9ef0b9e`.`id` = `testplatform`.`manufacturer`)
where
(
( `manyToOneFilterbcccebd00bc54d8da500be59e9ef0b9e`.`id` is not null )
)

Proposed change:
select
testplatform.identifier,
testplatform.name,
testplatform.description,
testplatform.id as id
from
`pobj_testplatform` `testplatform`
where
exists (
select
1
from
`pobj_organisation` `organisation`
where
`organisation`.id = testplatform.manufacturer
and (
organisation.active = true
)
)

Your pinned fields
Click on the next to a field label to start pinning.

Assignee

Unassigned

Reporter

Jan Jannek