MySQL Forums
Forum List  »  Newbie

Re: Benefits of indexing
Posted by: Rick James
Date: April 09, 2014 02:21PM

A little longer, ok. A lot longer? Let's see
SHOW CREATE TABLE
EXPLAIN SELECT ...
These may perform terribly:
* ON ABS(a.foo) = ABS(b.foo) -- functions prevent use of indexes
* INDEX(x,y) ... ON a.y = ... -- INDEXes are useful when including first field(s)
* LEFT JOIN -- this forces the order of the tables, preventing some optimizations

The EXPLAIN will have 2 rows -- one for the first table (often the smaller one), and one for the other table. That second row may say "Rows: 1" if it is efficient, and mostly oblivious to the size of the second table. Or the second row may say "type: ALL", in which case it could not use any index.

With the SHOW and EXPLAIN, we can give you more specific guidance.

Options: ReplyQuote


Subject
Written By
Posted
April 09, 2014 09:26AM
April 09, 2014 12:38PM
Re: Benefits of indexing
April 09, 2014 02:21PM
April 10, 2014 04:18AM
April 10, 2014 05:36AM
April 10, 2014 03:35PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.