Re: MySQL Queries - Full Question This Time :)
by "rudy" <r937(at)interlog.com>
|
Date: |
Tue, 15 Jan 2002 00:15:53 -0500 |
To: |
"HWG Techniques Email List" <hwg-techniques(at)hwg.org>, "Nathan" <natelyle(at)chartermi.net> |
|
todo: View
Thread,
Original
|
|
> AND (master.ID = artist.ID AND master.ID = track.ID);
there's your problem
first of all, they're varchars, and you'd be way better off using numbers
you're not into the millions, so you could use MEDIUMINT (3 bytes) or INT
(4 bytes)
also, i don't understand the 1-to-many relationships here
i'm going to assume a "master" is like a cd or album, and contains several
tracks
so it looks like both master and track IDs are actually artist IDs
then based on the numbers you gave, it looks like there are many artists in
the database with no masters
so right away, you might want to be using outer joins
also, this design does not allow for compilation albums, where the tracks
are all by different artists
maybe i don't understand your design, but i'd look at the data
relationships to make sure they're right, before i worked on making them
faster
rudy
HWG hwg-techniques mailing list archives,
maintained by Webmasters @ IWA