I have my EF framework query as below
.Include( d => d.Photos)
.ThenInclude( p => p.File )
This produces a mysql query with outer join on file table. I get query as below
Select * from
photos as p
INNER JOIN (
SELECT f.id
FROM files AS f
) AS t40 ON p.file_id = t40.id
How can I ensure to have query as below? The reason to have a single line is because the above query does not use primary key index and the performance on the query is very high
Select * from
photos as p
INNER JOIN files as f on p.file_id = f.id