Search query performance fixes
Tune the search query performance Move the DISTINCT on id clause to the top-level query in the RepoDb::getPdoStatementBySqlQuery() and remove them from queries generated by the SearchTerm. This should lead to far more optimal search queries.