The RIGHT JOIN
on this query causes a TABLE ACCESS FULL
on lims.operator
. A regular join runs quickly, but of course, the samples 'WHERE authorised_by IS NULL
' do not show up.
Is there a more efficient alternative to a RIGHT JOIN
in this case?
SELECT full_name
FROM (SELECT operator_id AS authorised_by, full_name
FROM lims.operator)
RIGHT JOIN (SELECT sample_id, authorised_by
FROM lims.sample
WHERE sample_template_id = 200)
USING (authorised_by)
NOTE: All columns shown (except full_name) are indexed and the primary key of some table.