Multicaster
Multicaster

Reputation: 155

EntityFramework Query taking too long 1st execution

I have a process which runs exactly similar query twice(There reasons why) , First execution takes about 3 minutes.

The same query when executes second time it takes 4 seconds.

What can be causing this ?

This behavior is consistent, both times query is fired on exact number of rows and columns.

Upvotes: 0

Views: 256

Answers (1)

Adel Khayata
Adel Khayata

Reputation: 2816

You need to generate views for your entity using : Entity Framework Power Tools Beta 3

It will generate pre-compiled views to improve performance.

Then you need to add the generated file ( EntityName.Views.cs ) to your project.

P.S: You need to generate views each time you modify your entity.

Upvotes: 1

Related Questions