Re: Inconsistent performance on a query
From: Steve Kass (skass_at_drew.edu)
Date: 07/21/04
- Next message: Steve Kass: "Re: Inconsistent performance on a query"
- Previous message: Jeremy: "Examining the contents of tuple"
- In reply to: spoons: "Re: Inconsistent performance on a query"
- Next in thread: Steve Kass: "Re: Inconsistent performance on a query"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 21 Jul 2004 14:38:09 -0400
Are you saying that if you leave out "where se.file_key" is null, it
runs much slower? If so, it sounds like it might be a bad query plan.
If the new server is multi-processor and the old one is not, you could
try it with OPTION (MAXDOP 1),
to see if a parallel plan is causing trouble.
If the number of rows involved is small, a workaround (until you figure
out something better) is
select ...
INTO #QuickResults
from ...
-- your query /without/ the IS NULL condition
select *
from #QuickResults
where file_key is null
If none of this helps, can you post the table definitions and the four
query plans (from SET SHOWPLAN_TEXT ON):
Plan for Server A, with IS NULL which runs fine
Plan for Server B, with IS NULL, the problem query
Plan for Server A, without IS NULL, which runs fine
Plan for Server B, without IS NULL, which runs fine
Steve Kass
Drew University
spoons wrote:
>The problem is with the 'is null' clause. The new server is more powerful than the old server and is dedicated to SQL Server.
>
>"Kenny" wrote:
>
>
>
>>If you have a lot of applications or schedule task running on that machine,
>>it could be your cpu or memory. check if your cpu or memory usage is high.
>>if you have multiple cpus, you can disable cpu 0 and use cpu 1, 2 and
>>other. READ about affinity mask advance option in book online.
>>
>>
>>
>>
>>"Bri Gipson" <nospam@aol.com> wrote in message
>>news:sp9tf0hc9v5r6rfbvf1naiuo7r2oj08vmt@4ax.com...
>>
>>
>>>I'm not sure how much this pertains to your issue, but where I work some
>>>
>>>
>>machines are faster than others... more CPU power, more memory, faster hard
>>drives. Particularly with differing CPUs and hard drive speeds you'll find a
>>great amount of difference on
>>
>>
>>>running a query on identical installs (database and SQL server settings).
>>>
>>>
>>Also check to see that your slower machine isn't running CPU intensive apps
>>or services.
>>
>>
>>>Cheers,
>>>Bri
>>>
>>>--
>>>
>>>On Wed, 21 Jul 2004 10:23:01 -0700, spoons
>>>
>>>
>><spoons@discussions.microsoft.com> wrote:
>>
>>
>>>>I have a select statement that runs in two seconds on one server and does
>>>>
>>>>
>>not complete running after twenty minutes on another server. I copied the
>>database from the first server and restored to a new server. The two
>>servers have the same SQL 2000 sp3, and I ran DBCC USEROPTIONS and received
>>the same result set from the two servers. The connections properties are
>>the same. The problem comes into play when the where clause at the end of
>>the query with the 'is null' clause is included. I would appreciate any
>>help in resolving this problem. Does this have to do with configuration
>>settings? Please view the query:
>>
>>
>>>>select sm.client_key, sm.location_key, sm.program_key, sm.file_key
>>>> , sm.form_type, sm.background_type, ris.index_type_code
>>>> , ris.index_code, ris.results_record_type, ris.dispatched_index_date
>>>> , ris.research_date,se.file_key as IsUpdate,rit.name
>>>> , rit.catagory_name, rit.jurisdiction_code,
>>>>
>>>>
>>ris.jurisdiction_state_code
>>
>>
>>>> , ris.jurisdiction_federal_code, ris.jurisdiction_county_code,
>>>>
>>>>
>>ris.method_code
>>
>>
>>>> , se.Date_Completed,rco.Completion_Indicator
>>>> from n_subject_master sm
>>>> join rome_index_subject ris on sm.file_key=ris.file_key
>>>> join wnrcadmin.rome_index_type rit on
>>>>
>>>>
>>ris.index_type_code=rit.index_type_code
>>
>>
>>>> join wnrcadmin.research_codes_overall rco on
>>>>
>>>>
>>ris.results_record_type=rco.code
>>
>>
>>>> left join summary_element se on ris.file_key=se.file_key
>>>> and ris.index_type_code=se.element_type_key
>>>> and ris.index_code=se.element_key
>>>>where se.file_key is null
>>>>
>>>>
>>
>>
>>
- Next message: Steve Kass: "Re: Inconsistent performance on a query"
- Previous message: Jeremy: "Examining the contents of tuple"
- In reply to: spoons: "Re: Inconsistent performance on a query"
- Next in thread: Steve Kass: "Re: Inconsistent performance on a query"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|