Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re:(Zigster) (OT) Improving a SQL JOIN statement

by zigster (Hermit)
on Apr 10, 2001 at 17:48 UTC ( [id://71324]=note: print w/replies, xml ) Need Help??


in reply to (OT) Improving a SQL JOIN statement

If you have a primary key then the join should be fully qualified. The main reason for slow joins is poor qualification. Do you have to have a DISTINCT in your sql? If so then your join qualification is not complete. You should look to be able to linke each row with exactly one other on the other table. If you have a primary key (and use this as a foriegn key all will be well. Unfortunatly without a lot more information it is difficult to know what to suggest.

Suffice to say that with the data volumes you are suggesting a two table join should return witnin seconds not minutes so you are right to optimise. Try getting some SQL analysis software and run your sql throught it. Look for full table scans.

Look in your sql for clauses that will defeat the indexes. Do you use TOUPPER LIKE or any similar sql. Rememeber it is all well having indexes only if the database can use them.

I HTH
--

Zigster

  • Comment on Re:(Zigster) (OT) Improving a SQL JOIN statement

Replies are listed 'Best First'.
Re: Re:(Zigster) (OT) Improving a SQL JOIN statement
by Masem (Monsignor) on Apr 10, 2001 at 17:55 UTC
    The this is, it's not a 1 to 1, it's a 1 ( from primary ) to many ( from secondary ), on the order of between 10 and 50 currently, but easily can go upwards.
    Dr. Michael K. Neylon - mneylon-pm@masemware.com || "You've left the lens cap of your mind on again, Pinky" - The Brain

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://71324]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (4)
As of 2024-04-24 11:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found