For Programmers: Free Programming Magazines  


Home > Archive > PHP SQL > January 2005 > Optimizing One-Line-Result-Query









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Optimizing One-Line-Result-Query
André Hänsel

2005-01-20, 3:57 am

I select by 6 columns in the where-clause to get one column.

When I know, that my query will result in only one column, is it wise to...?
- give a LIMIT 1? Does MySQL then stop searching when it found one line?
- define the 6 (dynamic-sized) columns as a key together? Probably not,
since that would result in an index with cardinality = rows in the table. Or
does MySQL somehow make it's indices static-sized to provider faster
searching in an index than in the table?

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com