Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
behbehi
Starting Member
5 Posts |
Posted - 2014-05-21 : 06:16:20
|
Hi guysI have a performance issue about fetching data from sql server. As my database is huge and Views are complicated, fetching data with ADO.NET takes a lot of time. I have reached the conclusion that IF I OPEN A TABLE FROM MANAGMENT STUDIO, THEN FETCHING IS FASTER FROM ADO.NET!!!I wanna to know why?!! And is a way to implementing a solution that simulating 'OPEN TABLE FROM MANAGMENT STUDIO' from ADO.NET?thank u |
|
gbritton
Master Smack Fu Yak Hacker
2780 Posts |
Posted - 2014-05-21 : 08:27:34
|
What do you mean by Open a table from Management Studio? Do you mean you select a few (or all) rows or put it in edit mode, or something else?. Could it simply be that whey you "open" the table from SSMS, SQL Caches part or all of it? That would result in subsequent queries being faster.I think what you need to do is study the execution plan for the query. Look for scan or spool steps and work out how to eliminate them. Consider unwinding the views so that your resulting query works only from the base tables |
|
|
behbehi
Starting Member
5 Posts |
Posted - 2014-05-21 : 09:12:18
|
Let meLet me tell you in few steps:1. I request a report from my c# app and it takes 4 sec to generat2. I go to Managment Studio and open a table, it's not important which table, just a table3. I request report from step 1 and it just takes 1 sec to generatis that caching? Is there any way to enable this caching from ADO.NET? |
|
|
behbehi
Starting Member
5 Posts |
Posted - 2014-05-21 : 09:13:37
|
Opening a table is just Right Click on table name and click on Open Table |
|
|
gbritton
Master Smack Fu Yak Hacker
2780 Posts |
Posted - 2014-05-21 : 14:51:12
|
There is no "Open Table" context menu item that I can see (SSMS 2012). I have:New TableDesignSelect top 1000 RowsEdit top 200 RowsScript table as >View DependenciesFull-text Index >Policies >FacetsStart PowerShellReports >RenameDeleteRefreshProperties...but no "Open"Caching is built-in in SQL Server, but it sounds like something else. In the Database Properties, do you have AutoClose set to "True"? |
|
|
behbehi
Starting Member
5 Posts |
Posted - 2014-05-22 : 01:37:57
|
Because I use SSMS 2005You know, It's not important you 'Select top 1000 Rows' or 'Open table'. If you open and see records in a table, Then fetching of all rows are faster from C# app (If fact from ADO.NET) |
|
|
gbritton
Master Smack Fu Yak Hacker
2780 Posts |
Posted - 2014-05-22 : 12:46:30
|
Did you check the AutoClose property on the Database? |
|
|
behbehi
Starting Member
5 Posts |
Posted - 2014-05-24 : 05:05:54
|
No It was ONWhen I changed it to OFF, Is working as I open a tableThank u gbritton :) |
|
|
|
|
|
|
|