Distinct doesn't lead to full table scans, it filters duplicates from the resultset. It's emitted to avoid duplicate filtering on the client. The runtime should cleverly decide whether distinct is needed (when duplicates could occur) and doesn't emit it when it's not possible duplicates will occur. Please use the very latest 2.6 runtime library build to make sure you have the fixes made in this area.