Solved

SQL 2005 Query Hangs and never returns results. If i update Stats it runs

Posted on 2006-07-20
3
565 Views
Last Modified: 2010-05-18
Heres the query


SELECT ve2.ID, ve3.VALUE_AS_STRING, ve5.VALUE_AS_TEXT, ve7.VALUE_AS_STRING, ve9.VALUE_AS_STRING,
ve11.VALUE_AS_STRING
FROM tblGRNT ve0 INNER JOIN tblGRNT2 ve1 ON ve1.GRANTEE_VEOID = ve0.VEOID
  INNER JOIN tblD)ve2 ON ve2.VEOID = ve1.DATAOBJECT_VEOID
  INNER JOIN tblDAve3 ON ve3.DATAOBJECT_VEOID = ve2.VEOID
  INNER JOIN tblMDAve4 ON ve4.VEOID = ve3.METAATTRIBUTE_VEOID
  INNER JOIN tblDAve5 ON ve5.DATAOBJECT_VEOID = ve2.VEOID
  INNER JOIN tblMDAve6 ON ve6.VEOID = ve5.METAATTRIBUTE_VEOID
  INNER JOIN tblDAve7 ON ve7.DATAOBJECT_VEOID = ve2.VEOID
  INNER JOIN tblMDAve8 ON ve8.VEOID = ve7.METAATTRIBUTE_VEOID
  INNER JOIN tblDAve9 ON ve9.DATAOBJECT_VEOID = ve2.VEOID
  INNER JOIN tblMDAve10 ON ve10.VEOID = ve9.METAATTRIBUTE_VEOID
  INNER JOIN tblDAve11 ON ve11.DATAOBJECT_VEOID = ve2.VEOID
  INNER JOIN tblMDAve12 ON ve12.VEOID = ve11.METAATTRIBUTE_VEOID
WHERE ve0.VEOID = 201 AND ve4.MET_NAME = 'ID' AND ve6.MET_NAME = 'PROJECT_TITLE'
  AND ve8.MET_NAME = 'AWARD_DATE' AND ve10.MET_NAME = 'GRANT_AMOUNT' AND ve12.MET_NAME = 'PAID_AMOUNT'
0
Comment
Question by:Mikal613
  • 2
3 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 17147321
I hope you have all the indexes on the fields that are in the join conditions
0
 
LVL 48

Author Comment

by:Mikal613
ID: 17147329
how do i check that?

(Hey angel long time no speak)
0
 
LVL 48

Author Comment

by:Mikal613
ID: 17154425
You were right can you tell me why it had to be that way?
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Viewers will learn how the fundamental information of how to create a table.

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question