On Wed, Oct 7, 2009 at 11:43 AM, Paul McNett <[email protected]> wrote: > > I believe MySQL's query analyzer does a good job selecting the best index to > use, > automatically. I've never found the need to research whether you can > explicitly > specify which index to use. So maybe it has that feature. :) >
Paul: You are correct that it's better to leave the processing to the optimizer, as the optimizer will recognize it when the composition of the tables change enough to suggest a different strategy to process tables. If you put hints in the queries, you are forcing one particular way of querying that might work at the moment, but might be sub-optimal later on. (How many developers have said "Worked fine on my machine with 100 records?" :) If you're dealing with a real performance problem with production data on production hardware and have already tried optimizing the hardware, memory usage, indexes and alternative queries, you can use a variety of hints, covered here: http://dev.mysql.com/doc/refman/5.0/en/index-hints.html -- Ted Roche, CMDEV: Certified MySQL 5.0 Developer Ted Roche & Associates, LLC http://www.tedroche.com _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/[email protected] ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

