all groups > sql server programming > november 2003 >
You're in the

sql server programming

group:

Merge join problem


Re: Merge join problem oj
11/19/2003 2:09:04 PM
sql server programming:
You can override with join hint.

e.g.
select *
from Northwind..Orders o
inner merge join
Northwind..[Order Details] od
on o.Orderid=od.Orderid

--
-oj
RAC v2.2 & QALite!
http://www.rac4sql.net


[quoted text, click to view]

Re: Merge join problem Louis Davidson
11/19/2003 6:39:39 PM
Don't expect order of output! If you want the table in primary key order,
add an ORDER BY clause. Then, if merge join is faster to return the values
in sorted order (and it sometimes will be) it will use it. No matter what
join criteria is, there is no guarantee your data will come back in any
order without the ORDER BY clause.

--
----------------------------------------------------------------------------
-----------
Louis Davidson (drsql@hotmail.com)
Compass Technology Management

Pro SQL Server 2000 Database Design
http://www.apress.com/book/bookDisplay.html?bID=266

Note: Please reply to the newsgroups only unless you are
interested in consulting services. All other replies will be ignored :)

[quoted text, click to view]

Re: Merge join problem Louis Davidson
11/19/2003 6:40:20 PM
Also, change the clock on your computer, please, it is not the 22nd of
November anywhere yet :)

--
----------------------------------------------------------------------------
-----------
Louis Davidson (drsql@hotmail.com)
Compass Technology Management

Pro SQL Server 2000 Database Design
http://www.apress.com/book/bookDisplay.html?bID=266

Note: Please reply to the newsgroups only unless you are
interested in consulting services. All other replies will be ignored :)

[quoted text, click to view]

Merge join problem Roy Goldhammer
11/22/2003 10:34:50 PM
Hello there

I have two tables. Offer, Rates
Offer table have primary key and the rates table have foreign key related to
the Offer table

When i open the query anlyser in the index list of the offers key suddenly
one of the fields with index is shows at first

As a result of that simple Select sentence show the table in the field order
and not the primary key order.

As a result of that the join between these two tables are loop join and not
marge join.

What i need to do to make the join to be marged and not looped?

AddThis Social Bookmark Button