Comment 6 for bug 661988

Revision history for this message
Stuart Bishop (stub) wrote :

For the query in Comment #5, there is no need to use LEFT OUTER JOINS and the ON join condition is duplicated in the WHERE clause (but this results in the same query plan, so this is just for clarity). Also, we should use IS FALSE rather than = FALSE, but in this case it again makes no difference.

A minor improvement to the plan can be gained by replacing UNION with UNION ALL in the EXIST clauses but this will be pretty trivial.

I've tried several different rewrites but can't really improve on this. Substring search on targetnamecache seems killer, but we knew this would never scale. We should consider just dropping this and relying on the fts match on this column.