Click here to Skip to main content
15,890,825 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Hello

Due to huge data fetching query of sql server in asp.net program making slow.

Please help me in details what should i use in sql server.


Thanks.
Posted
Comments
zyck 8-Feb-12 4:13am    
how many records do you Retrieve in your Database?
can you post your sql code
Aniket Yadav 8-Feb-12 4:16am    
Yes ZYCK Is Correct, Please Post Your Sample Code So That We Can Figure Out What And Where The Problem Lies.
Al Moje 8-Feb-12 4:19am    
Is your problem evolving slowness at page index change?
Sergey Alexandrovich Kryukov 8-Feb-12 4:19am    
Not a question -- yet. You can use "Improve question".
--SA
Herman<T>.Instance 8-Feb-12 4:22am    
start using async db calling

1 solution

Without much better information, it is not possible to be precise, but there are general recommendations:

If it is the data fetching that is slowing things down, then there is a simple solution: fetch less data.

If you are fetching all fields
SQL
SELECT * FROM ...
Then don't - select only the fields you need for the row.
SQL
SELECT Username, email FROM ...
If your database contains images for example, this can save a considerable amount of time.

If you are fetching a lot of records at one time, then don't: filter your records so you only retrieve those you need - presenting the user with lots of records is both slow and a waste of your time and theirs - how do you expect them to find the data they are interested in, if it is a single row out of 10,000?

Finally, if you are processing the data to extract some specific info from it, it may be worth moving the processing into a Stored Procedure so that the information ios condensed at the SQL Server instead of transferred and then condensed. And example would be transferring all teh rows so that you can add the total, rather than using the SQL SUM function and returning just the single final value./
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900