This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
I have a LINQ query
But instead of generating something like
LightSpeed generates a monster joining all three tables and selecting all columns from ALL those tables, without distinct, and then instead of returning me 200,000 integers, it returns 1.5M rows taking 5GB and more than a minute (and no, we won't argue about not needing those 200k integers - they are needed). I thought that this type of query would be trivial to generate. Any ideas? |
|
|
Is the IsActive property an entity property (e.g. contains no custom implementation) or is it code based? We shouldnt be pulling in all tables unless there is a client side projection which prevents us from selecting the specific properties needed as part of the query.
|
|
|
Not sure what you mean... But here it is.
The code is generated from the model. There was no fiddling with the code, at least as far as I know, just generated code. Is it what you have asked about? |
|
|
Yes that was what I was looking for - thanks. I would agree though that the query should be simpler, can you post a small repro project that reproduces this behavior so we can have a look into whats going on?
|
|
|
Will try to generate something tomorrow at work - the project is too big to try to cut out a repro from it. But I do not believe that there is anything special about it. Could it be about row counts in the database? In our case count a >> count b >> count c. Or is it about relationships between tables/entities? Tables have standard pk-fk on ids, and entities are not eagerly loading children, afaik. |
|
|
Thanks. LightSpeed will only issue that type of query when we have evaluated that the projection cannot be satisfied strictly with a server based query which then forces us to pull in everything about the entities to cater for any client side operations that need to occur before surfacing the final results. Hard to say what specifically is going on in this case without being able to debug this further.
|
|