Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12»»

query is taking long time to run Expand / Collapse
Author
Message
Posted Wednesday, August 21, 2013 8:59 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, December 12, 2014 10:51 AM
Points: 147, Visits: 423
Hi all

here i am executing the query "select * from tmp_Brad_Product_Configuration_12months"

while executing this it is taking 25 mins above and it is still executing.

what may be the reason. can anyone please advise me on this.
Post #1486764
Posted Wednesday, August 21, 2013 9:16 AM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Yesterday @ 7:08 PM
Points: 4,046, Visits: 9,205
If it's a simple "SELECT * FROM Table", I would look for blocking issues.
It's hard to give a correct advise with so little information. What's the size of the table? How many users use the database? Do you have something else in your query?



Luis C.
Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

Forum Etiquette: How to post data/code on a forum to get the best help
Post #1486767
Posted Wednesday, August 21, 2013 9:20 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Thursday, December 18, 2014 1:43 AM
Points: 6,890, Visits: 14,254
Post the definition of the object tmp_Brad_Product_Configuration_12months. Without knowing what it is, it's difficult to answer your question with any degree of confidence.

“Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
Exploring Recursive CTEs by Example Dwain Camps
Post #1486769
Posted Wednesday, August 21, 2013 10:34 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, December 12, 2014 10:51 AM
Points: 147, Visits: 423
here in this table 9112177 records are there 6.3gb data is available.

Post #1486804
Posted Wednesday, August 21, 2013 10:52 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, December 12, 2014 10:51 AM
Points: 147, Visits: 423
how can i find the fragmentation on this single query
Post #1486807
Posted Wednesday, August 21, 2013 11:10 AM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Monday, November 24, 2014 5:46 AM
Points: 4,031, Visits: 7,172
How many columns are in this "large" table?

SELECT * (2 or 3 columns) FROM TABLE will run quite well most of the time, whereas if you have dozens of columns in that table, it will take quite some time to pull in the information as you'll be scanning the clustered index (assuming the table has one)

Without seeing the DDL or an execution plan, it's difficult to tell where your issue is...could be a matter or just tweaking a few included columns in an existing non-clustered index (assuming these exist as well)

Do you really need all columns to be returned?


______________________________________________________________________________
"Never argue with an idiot; They'll drag you down to their level and beat you with experience"
Post #1486815
Posted Wednesday, August 21, 2013 11:19 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, December 12, 2014 10:51 AM
Points: 147, Visits: 423
we have 26 columns in that. the execution plan is showing as table scan

Post #1486818
Posted Wednesday, August 21, 2013 11:32 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, December 12, 2014 10:51 AM
Points: 147, Visits: 423
here we found that memory usage is showing as 99%
Post #1486823
Posted Wednesday, August 21, 2013 11:37 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: Administrators
Last Login: 2 days ago @ 3:11 PM
Points: 31,368, Visits: 15,837
You are pulling back 6GB of data. If you're doing this in a client, you might have rendering issues, as well as IO/memory issues on the server. 6GB of data will slide through the buffer cache and clear out things.

If any other user is querying the table, they might be blocking. Check sp_who2 for blocking connections. Don't do a "select *" unless you really need all that data.







Follow me on Twitter: @way0utwest

Forum Etiquette: How to post data/code on a forum to get the best help
Post #1486825
Posted Wednesday, August 21, 2013 11:52 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, December 12, 2014 10:51 AM
Points: 147, Visits: 423
no we are not executing anything still physical memory usage is showing as 95.45gb.

i have checked for blockages there is no blockages.

how can i solve this memory issue.

Post #1486830
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse