Welcome to dbFreaks.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

When the hash will involve in explain plan?

 
   Database Help (Home) -> Datamining RSS
Next:  Neural Networks  
Author Message
Lynn

External


Since: Feb 01, 2008
Posts: 14



(Msg. 1) Posted: Thu Jan 31, 2008 4:10 pm
Post subject: When the hash will involve in explain plan?
Archived from groups: microsoft>public>sqlserver>datamining (more info?)

Hi,

We runt he following question against both QA and Prod, but the sorting of
the data is different even though both server's sorting and table/index
structure are the same. (Region table -- clusterind:Region_number; Bank
table -- clusterind:BankID; Fileset table -- clisterind:filesetID)

select Region.*, bank.*, FileSet.*
from Region left join Bank on region.Region_Number = bank.Region_Number
left join FileSet on FileSet.bankID = Bank.bankID
where Region.Region_Number <> '00000'

In QA, the return record sorting is by Region.Region_number, In prod, the
sorting is by fileset.filesetid.

After examing the explain plan against QA and PROD, one step is different.
QA -- Nested Loop/Left join fileset on ..
Prod -- Hash Match/Left join fileset on ..

Not sure why QA and PROD use the different explain plan? Looks like
different explain plan will have different return record sorting. If I add
"order by region.region_number" in prod question, then the explain plan will
be the same as QA.

Please advise why this situation happen? And, in what situation, the Hash
Match will be used? Thank you.
--
Best Regards,

Lynn

 >> Stay informed about: When the hash will involve in explain plan? 
Back to top
Login to vote
Lynn

External


Since: Feb 01, 2008
Posts: 14



(Msg. 2) Posted: Tue Feb 05, 2008 10:02 am
Post subject: RE: When the hash will involve in explain plan? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Dejan,

thank you for your response. The statistics is all updated very recent. In
fact, PROD server is more up-to-date than QA.

--
Best Regards,

Lynn


"Lynn" wrote:

> Hi,
>
> We runt he following question against both QA and Prod, but the sorting of
> the data is different even though both server's sorting and table/index
> structure are the same. (Region table -- clusterind:Region_number; Bank
> table -- clusterind:BankID; Fileset table -- clisterind:filesetID)
>
> select Region.*, bank.*, FileSet.*
> from Region left join Bank on region.Region_Number = bank.Region_Number
> left join FileSet on FileSet.bankID = Bank.bankID
> where Region.Region_Number <> '00000'
>
> In QA, the return record sorting is by Region.Region_number, In prod, the
> sorting is by fileset.filesetid.
>
> After examing the explain plan against QA and PROD, one step is different.
> QA -- Nested Loop/Left join fileset on ..
> Prod -- Hash Match/Left join fileset on ..
>
> Not sure why QA and PROD use the different explain plan? Looks like
> different explain plan will have different return record sorting. If I add
> "order by region.region_number" in prod question, then the explain plan will
> be the same as QA.
>
> Please advise why this situation happen? And, in what situation, the Hash
> Match will be used? Thank you.
> --
> Best Regards,
>
> Lynn

 >> Stay informed about: When the hash will involve in explain plan? 
Back to top
Login to vote
Dejan Sarka

External


Since: Mar 18, 2004
Posts: 103



(Msg. 3) Posted: Tue Feb 05, 2008 6:10 pm
Post subject: Re: When the hash will involve in explain plan? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

>
> We runt he following question against both QA and Prod, but the sorting of
> the data is different even though both server's sorting and table/index
> structure are the same. (Region table -- clusterind:Region_number; Bank
> table -- clusterind:BankID; Fileset table -- clisterind:filesetID)
>
> select Region.*, bank.*, FileSet.*
> from Region left join Bank on region.Region_Number = bank.Region_Number
> left join FileSet on FileSet.bankID = Bank.bankID
> where Region.Region_Number <> '00000'
>
> In QA, the return record sorting is by Region.Region_number, In prod, the
> sorting is by fileset.filesetid.
>
> After examing the explain plan against QA and PROD, one step is different.
> QA -- Nested Loop/Left join fileset on ..
> Prod -- Hash Match/Left join fileset on ..
>
> Not sure why QA and PROD use the different explain plan? Looks like
> different explain plan will have different return record sorting. If I
> add
> "order by region.region_number" in prod question, then the explain plan
> will
> be the same as QA.
>
> Please advise why this situation happen? And, in what situation, the Hash
> Match will be used? Thank you.

My guess is hash join is used because statistics is not updated on the
server where you use the PROD app. Do pelase check the UPDATE STATISTICS
command in Books OnLine.

--
Dejan Sarka
http://blogs.solidq.com/EN/dsarka/default.aspx
 >> Stay informed about: When the hash will involve in explain plan? 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Collation Problem any help - Hello all : My problem is like the following I have an online databse with a latin collation, this database is using ntext and nvarchar values that was with our previous admin ok the problem is in the data is stored should use another collation (the...

Reprocessing a mining model - I'm currently developing a user registration prototype. The aim is to classify certain types of users. However, after the registration I query a decision tree model in Analysis Services with DMX and I want to send the user data into the warehouse to....

Trying to cut down query times - I have a query that is based on two other queries that are based on tables in a database. All of the queries that are used for this final query use grouping and totals. In the application I am making, I need to choose a date range to select the subset....

Update serial number in database - Hi, I want to update specific fields in a existing table in SQL database as below example: L240100001-LG L240100002-LG *serial number is difficult to update one by one L240100003-LG L240100004-LG L240100005-LG change to L240100001-L L240100002-L..

Newbie question - I have SQL Server 2000. What add-ons do I need to try data mining, and where do I best go for resources/references?
   Database Help (Home) -> Datamining All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]