Advertisement

07.26.2007 at 04:11AM PDT, ID: 22722279
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.6

Query taking exceptionally long time

Asked by Marcusw in MS SQL Server

Tags: , ,

could somebody give me some ideas as to what is wrong with this query

select count(*) TOTAL ,
sum(case when GotContact = 1 then 1 else 0 end) GotContact,
sum(case when GotPhone = 1 then 1 else 0 end) GotTel,
sum(CASE WHEN GotEmail = 1 THEN 1 ELSE 0 END) GotEmail
from Data..tblCompany
WHERE (ID in (select ID from tbl1 where Code in (f222','e896','w834'))
or SIC in ('74111') (=)

it does not seem to run, i've left it for over 30 min but it just keeps running

if i run the same code without the line
or SIC in ('74111')
it runs in 1.5 seconds

or if i remove
(ID in (select ID from tbl1 where Code in (f222','e896','w834')))
it runs in about 5 seconds.

it is counting a lot of data
tblCompany has around 3 million records and tbl1 has around 50 million.

tblCompany has a clustered index on its ID and tbl1 has a clusterd index on code.

i have no ideas why the 2 together take so long


Start Free Trial
[+][-]07.26.2007 at 04:18AM PDT, ID: 19573343

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.26.2007 at 04:28AM PDT, ID: 19573399

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.26.2007 at 04:31AM PDT, ID: 19573418

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.26.2007 at 04:58AM PDT, ID: 19573561

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.26.2007 at 05:04AM PDT, ID: 19573599

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.26.2007 at 06:02AM PDT, ID: 19573998

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.26.2007 at 06:11AM PDT, ID: 19574053

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.26.2007 at 06:22AM PDT, ID: 19574125

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.26.2007 at 06:37AM PDT, ID: 19574272

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.26.2007 at 06:52AM PDT, ID: 19574415

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.30.2007 at 05:18PM PDT, ID: 19596883

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.31.2007 at 04:00AM PDT, ID: 19599126

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: MS SQL Server
Tags: take, time, why
Sign Up Now!
Solution Provided By: patrikt
Participating Experts: 3
Solution Grade: A
 
 
[+][-]09.02.2008 at 10:34PM PDT, ID: 22374384

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]09.08.2008 at 04:49PM PDT, ID: 22422723

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-42