Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query Plan Problem: Parellelism/Repartioning Streams

Status
Not open for further replies.

rsai

Programmer
Oct 9, 2002
16
0
0
GB
Hi
I have a query which runs in about 7 minutes, when I add another column from a simple (small) lookup table joined to one of the other tables already in the query the query time drops to 2 minutes. When I examine the query plans for the two queries the major difference is that the faster (but more complex) query invokes Paralleism/Repartitioning Streams or Parallelism/ Broadcast at virtually every stage in the plan whilst none is invoked for the slower/simpler query.

Can anyone explain what is affecting the query plan and how I can ensure that the most efficient plan is being used in all cases.

I have been through each of the tables involved in the slower query and updated the statistics on the indexes and the columns, but it makes no difference.
 
well have you got indexes on the lookup table

What you need to look out for is index scan and table scan

index scan = FAST
table scan = Slow


also when you join to the look up tablle your are narrowing the serach criteria ( i am assuming)

You should hear more advice hopefully.

Sam
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top