LINQConnect very slow (generates millions of queries!)

LINQConnect very slow (generates millions of queries!)

Postby ronan.thibaudau » Fri 03 Feb 2012 22:13

Hello there,
I'm turning to the forums as i didn't get an answer to this question from support.
I bought LinqConnect and am very surprised to see the kind of SQL it generates as, as far as i've seen, it fares much worse than LINQ to SQL / Entities in generation.
Here's an example

context.T_CAI_Produits
.LoadWith(prod=>prod.T_CAI_L_Produits)
.Select(prod => new
{
prodl = prod.T_CAI_L_Produits
.Select(prodl=>new
{
prodl.CULT_Id,
prodl.PROD_L_Titre
})
.ToList()
}).ToList();

With linq to SQL i get this :

SELECT [t1].[CULT_Id], [t1].[PROD_L_Titre], (
SELECT COUNT(*)
FROM [T_CAI_L_Produit] AS [t2]
WHERE [t2].[PROD_Id] = [t0].[PROD_Id]
) AS [value]
FROM [T_CAI_Produit] AS [t0]
LEFT OUTER JOIN [T_CAI_L_Produit] AS [t1] ON [t1].[PROD_Id] = [t0].[PROD_Id]
ORDER BY [t0].[PROD_Id], [t1].[CULT_Id]

With LinqConnect i get

SELECT [t1].[PROD_Id]
FROM [dbo].[T_CAI_Produit] [t1]

+ 1 SQL query PER row in T_CAI_L_Produits (millions)

Now linq to SQL/Entities also fall back to multiple queries on some complex queries, but here i'm assuming i "have" to be doing something wrong as i haven't seen any such concerns in the first 5 pages of this forum and this sounds like something that couldn't work on any project in production.

I'm using the SQL Server provider

Any ideas?
ronan.thibaudau
 
Posts: 1
Joined: Fri 03 Feb 2012 22:05

Postby StanislavK » Thu 09 Feb 2012 16:18

Thank you for the report, we have reproduced the issue. We will analyze it and inform you about the results as soon as possible.
StanislavK
Devart Team
 
Posts: 1710
Joined: Thu 03 Dec 2009 10:48


Return to LinqConnect (LINQ to SQL support)