I am using Entity Framework 6 code first and Postgresql database, I came across that EF generates unnecessarily complex query that runs few seconds, but can be optimized to few miliseconds.
I have an optimized query based on dbContext.Set().ToQueryString(), I want to run this using FromSqlRaw method, but I get an error “column reference “id” is ambiguous”
In the query there are multiple tables and they have id column, but in the query they are with aliases, such as a.id, b.id etc. Although I am receiving that error. How can I fix the error?