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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Too many joins?

Status
Not open for further replies.

Joiner

MIS
Jun 20, 2001
22
US
Hi All.
I have a main table (call it Orders) which has approximately 60 columns and over 1 million records (and growing). Of these 60 columns, approximately 25 are IDs which reference a lookup table for values that define numerous categories and types for each order. Each of these categories and types are required information. The problem is that every time I write a stored procedure against this table, I am using anywhere from 12-25 joins to return all of the necessary information. My questions are:
Is this an unacceptable number of joins in a single query? What is the best practice for reducing the number of joins? - I'd hate to denormalize but I would consider it if its the only option.
Any advice or tips would be greatly appreciated.
Thanks.
 
you can sometimes reduce joins by using subquereies as well, depending on the app, would it be possible to create temporary tables with denormalized results? if the data is like a warehouse app, you could refresh the tables daily... certainly 12 - 25 tables in a join is an excessively large number. Paul
 
Thanks for the reply.
Temporary tables actually make good sense here.
 
1. Are you having performance issues? If not why are you worrying?

2. Have you considered creating views that take care of the joins for you. It won't make much difference to the perfomance but it will sure make writing the stored procedures a lot less tedious.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top