all groups > sql server programming > march 2004 >
You're in the

sql server programming

group:

Optimizing Joins


Re: Optimizing Joins Adam Machanic
3/31/2004 12:05:01 PM
sql server programming: Why not just directly SELECT DISTINCT? You shouldn't need to use a derived
table for this...


[quoted text, click to view]

Re: Optimizing Joins Daniel P.
3/31/2004 12:51:35 PM
What are you trying to accomplish by:
WHERE a.RecordId <> b.RecordId
?


[quoted text, click to view]

Optimizing Joins Harman Dhillon
3/31/2004 10:25:50 PM
I have two tables each containing records to the tune of 30,000 records...

I need to create an optimized join on the two tables...Apart from creating
necessary indexes
is their a way to improve the join performance...

The query is:

SELECT DISTINCT Related.* FROM /* Ignoring duplicate related records */
(SELECT b.RecordId,a.PayeeVendorNumber , a.GeneralizedInvoiceNumber,
b.InvoiceAmountPaid
FROM TableForExceptionSet a INNER JOIN PaymentHistory as b
ON a.PayeeVendorNumber = b.PayeeVendorNumber
AND a.GeneralizedInvoiceNumber = b.GeneralizedInvoiceNumber
WHERE a.RecordId <> b.RecordId
) AS Related

Plz help..

Regards,
Harman.


AddThis Social Bookmark Button