Lilia Gesheva

Hi,

I need some help and I hope some of you have a solution to my problem.

We are starting new project which will include about 200 tables in the database. We would like to use Linq that is why we did some tests. What we found is that linq runs very fast with stored procedures and it is better than using datasets and datareaders.

The problem came when we tried to add all the tables that we have in one context. In this case the same sql statements executed three times slowlier.

We had an idea to make several contexts with different tables but in our case it is almost impossible because all the tables are direct or indirect related.

It would be good if the different contexts could use the same entities that are in different files but Linq designer generates the code for the entitities in the data context file.

Any suggestions about solving this problem are appreciated.



Re: ADO.NET (Pre-release) DLinq performance

Zlatko Michailov - MSFT

Have you considered using LINQ to Entities If so, have you compared the performance

Zlatko Michailov

Program Manager, Data Programmability

Microsoft Corp.






Re: ADO.NET (Pre-release) DLinq performance

Lilia Gesheva

Hi Zlatko,

We did some tests with l2e. When loading only one entity for the first time it works much slowlier than the data reader. When executing get all, the performance is almost the same.

One other thing that bothers me about l2e is that currently it doesn't support stored procedure, right





Re: ADO.NET (Pre-release) DLinq performance

Zlatko Michailov - MSFT

We support stored procedures for both modification (insert/update/delete) and retrieval. The documentation didnĄŻt make it unfortunately. If you are willing to give it a try, IĄŻll supply you with examples. HereĄŻs a thread that discusses retrieval: http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=1829227&SiteID=1

BTW, at what level/API do you query the model: LINQ, ObjectQuery<T>, or EntityClient If performance is critical to you, you should consider EntityClient ¨C it has the least overhead out of those three.

Zlatko Michailov

Program Manager, Data Programmability

Microsoft Corp.






Re: ADO.NET (Pre-release) DLinq performance

Lilia Gesheva

Hi Zlatko,

We checked the examples that you have provided and did some tests with EntityClient. It's performance was better. Thank you very much for your answer.

I have another question. We use Entity Client to generate the functions for stored procedures (.ssdl) but we didn't find any automatic way to map these functions (msl, csdl).

Is there any tool to make this generation

SSDL:

<Function Name="PeopleByState"
IsComposable="false">

<Parameter Name="state" Mode="in" Type="char" />

</Function>

MSL:

<FunctionImportMapping FunctionName="Target.PeopleByState"
FunctionImportName="PeopleByState">

</FunctionImportMapping>

CSDL:

<FunctionImport Name="PeopleByState" EntitySet="CPeople" ReturnType="Collection(Self.TPerson)">

<Parameter Name="state" Mode="in" Type="String" />

</FunctionImport>





Re: ADO.NET (Pre-release) DLinq performance

Zlatko Michailov - MSFT

Mapping stored procedures cannot be done entirely automatically since the tool cannot know what exactly the procedure returns. Our partner team is working on a more sophisticated tool that will gather user input and will do that mapping. It should be available in an upcoming CTP.

IĄŻm marking this thread as answered. Please feel free to post more questions.

Zlatko Michailov

Program Manager, Data Programmability

Microsoft Corp.






Re: ADO.NET (Pre-release) DLinq performance

Lilia Gesheva

Hi Zlatko,

Thank you very much for your help.