DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

(mysql.info.gz) Index merge intersection

Info Catalog (mysql.info.gz) Index Merge optimization (mysql.info.gz) Index Merge optimization (mysql.info.gz) Index merge union
 
 7.2.6.1 Index Merge Intersection Access Algorithm
 .................................................
 
 This access algorithm can be employed when a `WHERE' clause was
 converted to several range conditions on different keys combined with
 `AND', and each condition is one of the following:
 
    * In this form, where the index has exactly N parts (that is, all
      index parts are covered):
 
           KEY_PART1=CONST1 AND KEY_PART2=CONST2 ... AND KEY_PARTN=CONSTN
 
    * Any range condition over a primary key of an `InnoDB' or `BDB'
      table.
 
 
 Here are some examples:
 
      SELECT * FROM INNODB_TABLE WHERE PRIMARY_KEY < 10 AND KEY_COL1=20;
 
      SELECT * FROM TBL_NAME
      WHERE (KEY1_PART1=1 AND KEY1_PART2=2) AND KEY2=2;
 
 The Index Merge intersection algorithm performs simultaneous scans on
 all used indexes and produces the intersection of row sequences that it
 receives from the merged index scans.
 
 If all columns used in the query are covered by the used indexes, full
 table records will not be retrieved (`EXPLAIN' output will contain
 `Using index' in `Extra' field in this case).  Here is an example of
 such query:
 
      SELECT COUNT(*) FROM t1 WHERE key1=1 AND key2=1;
 
 If the used indexes don't cover all columns used in the query, full
 records will be retrieved only when the range conditions for all used
 keys are satisfied.
 
 If one of the merged conditions is a condition over a primary key of an
 `InnoDB' or `BDB' table, it is not used for record retrieval, but is
 used to filter out records retrieved using other conditions.
 
Info Catalog (mysql.info.gz) Index Merge optimization (mysql.info.gz) Index Merge optimization (mysql.info.gz) Index merge union
automatically generated byinfo2html