Hello every one I am working on an web application using vs2015,MVC5 with E.F6 and LINQ query. When i have added 62,91,456 records in sql server database. When i Query through LINQ my application are performing very poor and slow taking too much time to load records. I have also added paging using skip() and take() LINQ functions. I am not understanding about SQL query means is it running at database side or at server side? Please help me. When i search any specific record using jquery autoload UI the errors comes server error 505 and code not work my whole system become hang and slow. Is there any solutions to make speed fast of my application?
7 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Thanks every one for your reply. I have solved the problem.actually the problem was in my LINQ query which was retrieving SELECT * instead of SELECT TOP(10) statement internally so all 6 millions records are selected at once :)
when i remove tolist() method and use skip() and take() for custom paging in single LINQ IQueryable var type my application become fast.Now it can load more than 6 millions records very fast.
tolist() method load all records and does not use SELECT TOP(10).
I advice you don't use tolist() in single statement of your LINQ query. Use skip and take. You can use tolist() when you pass query to your Model. Always use IQueryable generic type because it is used for databases. If you need paging for large records use custom paging such as take() and skip() function. They translate into top(10) SQL query and your application performs very fast
I think the problem there is you're having an internal error "505". The server doesn't response back to your client because you are having an error at the server which causes your page to hang. You need to debug your code and figure out what is causing the error.
Vincent Maverick DuranoPosted Jun 28, 2016, 3:38 PM
Guest UserPosted Jun 28, 2016, 3:22 PM
Vincent Maverick DuranoPosted Jun 28, 2016, 10:37 AM
Vinay SinghPosted Jun 27, 2016, 2:12 AM
Guest UserPosted Jun 27, 2016, 1:50 AM
My model DbContext class:
My action method in controller class:
My pagination class:
Akshay PhadkePosted Jun 27, 2016, 12:28 AM
Ehsan SajjadPosted Jun 26, 2016, 7:10 PM