This is a migrated thread and some comments may be shown as answers.

SQL Generated From LINQ Query to Telerik ORM

0 Answers 58 Views
Data Access Free Edition
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Gary
Top achievements
Rank 1
Gary asked on 11 Nov 2016, 03:28 PM

I am experiencing some confusion on SQL generated from a fairly standard LINQ query. 

01.var sessionQ = from sessionHdr in headersQ
02.   join sessionBody in bodyQ on
03.        sessionHdr.ID equals sessionBody.ID into sessionList
04.   from sessionJSON in sessionList.DefaultIfEmpty()
05.   where sessionHdr.Format == 13
06. 
07.   select new WITransmitsVP
08.   {
09.      ...
10.   };

 

Using this LINQ syntax for an OUTER JOIN I was expecting the SQL (ORACLE) generated to look something like the following ... 

1.SELECT
2.    ...
3. 
4.FROM "XFEVP"."WI_TRANSMITS_VP" a
5.    INNER JOIN "XFEVP"."WI_TRANSMITS_VP_MSG" b ON
6.      a."MESSAGE_ID" = b."MESSAGE_ID"
7.WHERE a."MESSAGE_ID" = 60412762;

 

Bun instead when I log the output I am seeing  ...

01.SELECT
02.    ...
03. 
04.FROM "XFEVP"."WI_TRANSMITS_VP" a
05.WHERE a."MESSAGE_ID" = :p0                                      
06.ORDER BY COL1 
07. 
08.SELECT
09.    ...
10. 
11.FROM "XFEVP"."WI_TRANSMITS_VP_MSG" a
12.ORDER BY COL1

 

Two entirely separate SELECT statements. Since the second table contains MILLIONS of records the component making the call eventually crashes due to memory issues after many many minutes of latency.

 

Why am I not getting a actual JOIN statement in the generated SQL? What's the workaround or fix?

 

Thank You,

Gary

 

Tags
Data Access Free Edition
Asked by
Gary
Top achievements
Rank 1
Share this question
or