Re: MySQL Queries - Full Question This Time :)

by Nathan <natelyle(at)chartermi.net>

 Date:  Tue, 15 Jan 2002 14:22:04 -0500
 To:  HWG Techniques Email List <hwg-techniques(at)hwg.org>
 References:  2
  todo: View Thread, Original
>Also you might want to consider breaking this into three separate
>searches with each one only searching one table, then consturcting a
>complete record after a selection has been made -- in fact you might try
>running your query as *three* queries and see the speed difference, show
>the hits for artists, songs and albums separately -- I don't normally
>recommend running 3 queries where you can do one, but it might be
>interesting to try --

This was actually my second attack. I tried doing seperate searches,
compiling a list of ID's which I then sorted and weeded with the PHP code
and did a final search from that list. All put together, this actually took
about the same amount of time, believe it or not. :)  It was a  lot more
complicated as far as coding, though, and I like to try to simplify
everything as much as possible.

>Oft times it becomes a balance between correct database design and what
>works;)

I'm thinking (partially from my own analysis before and partially from what
I'm hearing now) that I'm going to end up having to reconfigure the
structure a bit, which will hopefully allow for better indexing. I'm just
not quite sure yet how to go about this....

>Also, you can try using RLIKE and alternation in the pattern rather than
>keyword LIKE, keyword LIKE ...

I'm going to play with using regexpressions later this afternoon, for the
sake of curiosity. I'll holler if that ends up making a significant
difference...

~ Nathan Lyle

Email: natelyle(at)chartermi.net
Phone: (906)485-4806
http://www.nathanlyle.com

"Those that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety." - Ben Franklin

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA