Solved

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

Posted on 2006-07-20
3
547 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 142

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

I wrote this interesting script that really help me find jobs or procedures when working in a huge environment. I could I have written it as a Procedure but then I would have to have it on each machine or have a link to a server-related search that …
I have a large data set and a SSIS package. How can I load this file in multi threading?
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

867 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now