Print Page | Close Window

Compiled Queries

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=3162
Printed Date: 13-May-2026 at 4:33am


Topic: Compiled Queries
Posted By: darrelmiller
Subject: Compiled Queries
Date Posted: 16-Dec-2011 at 7:18am
I know this has been asked in the past and at the time it was being considered for inclusion, but has any progress been make on making compiled queries available.

The reason I would like to use them is due to the significant overhead that EF has when compiling queries with a number of Includes().  

Even if we were limited to being able to only compile named queries that are defined in a NamedQueryProvider, that would be sufficient.



Replies:
Posted By: WardBell
Date Posted: 16-Dec-2011 at 12:13pm
We have considered it seriously. But then we noticed that the EF team is promising to compile them automatically (a reversal of their original position on the viability of automated query compilation). "Auto-compilation" is described by http://msdn.microsoft.com/en-us/magazine/ee532098.aspx?sdmr=SrikanthMandadi&sdmi=authors -


Posted By: darrelmiller
Date Posted: 16-Dec-2011 at 12:24pm
Thanks for the link.  It's good to see that it is on the horizon.

I haven't been able to test the performance of the compiled query because I can't compile the query!  However, 4 seconds to compile a query that takes 8ms for SQL Server to execute seems like it is ripe for optimization.

Darrel


Posted By: WardBell
Date Posted: 16-Dec-2011 at 12:47pm
4 seconds to compile? What kind of query is that?
I assume you are not including the dog-slow start up time (for which you might explore Entity Framework http://msdn.microsoft.com/en-us/library/bb896240.aspx - View Generation ... which IS something you can do for a DevForce app).
 
When I suggested testing perf I meant by composing the query in raw EF rather than through DF. All DF entities are EF entities so you can use them in raw EF queries. Of course such an experiment requires the kind of familiarity with EF from which we try to protect you :).


Posted By: hijaggu
Date Posted: 20-Dec-2011 at 3:15pm
Any update on Compiled Queries.


Posted By: WardBell
Date Posted: 20-Dec-2011 at 5:41pm
No. We are waiting for word on the release of the EF 4.x that supports automated Compiled Queries. I have no indications from MS about when that will happen at this time. Please ping the EF team yourself. Maybe we can goad them into action.


Posted By: PascalSchmitt
Date Posted: 31-Aug-2012 at 2:07am
Hi,

Does compiled queries in EF 4.5 improve query execution time in DevForce ?
Is there any link between Devforce Query Cache and EF compiled queries ?

Thanks,




Print Page | Close Window