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.

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 query performance

Author  Topic 

nitin1111
Starting Member

13 Posts

Posted - 2010-05-10 : 07:29:54
Hi,

After executing query I am getting first row of the result set in 3 secs.It will start displaying other rows at back end But to show all 11 lacks records it will take almost 3 mins and during that time application window hangs users will be waiting to see the result.

why it is happening?
is there anything at application side so that end users (application users)are also able to start seeing the data instead of waiting for full result set to complete?


Thanks

M.N.Dani

DBA in the making
Aged Yak Warrior

638 Posts

Posted - 2010-05-10 : 07:38:26
Here's what you need to give us:

- Table definitions for all table in the query, including indexes
- A row count from each of the above tables
- The query you're running
- The actual execution plan for the query

Also, if you run the query with the following, it will print messages in the Messages window of SSMS, so supply those as well.
SET STATISTICS IO ON
GO
SET STATISTICS TIME ON
GO


------------------------------------------------------------------------------------
Any and all code contained within this post comes with a 100% money back guarantee.
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-05-10 : 07:39:03
Hm...
11 lacks records are 11 * 100000 = 1100000 - am I right?

Who wants to see 11 lacks records in an application????


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-05-10 : 07:42:12
Or am I wrong because what I mean is usually known as lakh and not lacks...


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

nitin1111
Starting Member

13 Posts

Posted - 2010-05-10 : 07:52:03
Hi,

select query is selecting from view and one table retrives 100 records.But the view is accesing one more view and table.

means select * from table A joins view A.
View A is accesSing view b and tables.

I guess if we are selecting from view, defination of the view will execute first.and if i am giving select * from view A ...IT WILL RETRIVE 11 LACKS Record..
Thanks



M.N.Dani
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2010-05-10 : 08:04:34
Shouldn't do, the definition from the VIEW is (in effect) inserted into your query syntax to make a composite query, and that is then optimised. So it should be no different to if you wrote out the whole query without using VIEWs.
Go to Top of Page
   

- Advertisement -