Hi Walter,

Walter Heck - OlinData.com wrote:
Hey Tim, all

On Wed, Jun 24, 2009 at 10:03 AM, Little,
Timothy<tlit...@thomaspublishing.com> wrote:
Why, you might ask, index on physmessage_id?  Because then the db won't
have to do a fetch on items from the table since it's in the INDEX
itself, saving any unnecessary reads.
FYI: That only holds true for InnoDB, not for MyISAM.


I think you have confused the InnoDB behavior of using the entire PRIMARY KEY as the unique row identifier for each entry in a secondary key with the practice of defining a "covering index".

Tim was correct: an index on (blocksize,physmessage_id) would allow that query to avoid any direct reads of the data table as all of the information for the query would have come from the index itself (regardless of database engine).

--
Shawn Green, MySQL Senior Support Engineer
Sun Microsystems, Inc.
Office: Blountville, TN



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql?unsub=arch...@jab.org

Reply via email to