mysql - What does FirstMatch mean in a EXPLAIN statement? -


today noticed "new" type in explain of statement.

this query

select urlid,'61','australia'  dbase.phonenumbers urlid in (select urlid dbase.phonenumbers                 phonenumber '+31%') , phonenumber '+61%' 

and explain gives this,

phonenumbers    range   urlid_phonenumber,phonenumber   phonenumber        12                               4176    using phonenumbers    ref     urlid_phonenumber,phonenumber   urlid_phonenumber   4   dbase.phonenumbers.urlid    4       using where; using index; firstmatch(phonenumbers) 

what firstmatch(phonenumbers) mean? never seen before , couldnt find quick enough explain it.

it strategy avoids production of duplicates short-cutting execution first genuine match found.

so firstmatch(phonenumbers) means have produced 1 matching record combination, short-cut execution , jump phonenumbers table.

from firstmatch strategy

  • the firstmatch strategy works executing subquery , short-cutting execution first match found.
  • this means, subquery tables must after of parent select's tables referred subquery predicate.
  • explain shows firstmatch "firstmatch(tablen)".
  • the strategy can handle correlated subqueries.
  • but cannot applied if subquery has meaningful group and/or aggregate functions.
  • use of firstmatch strategy controlled firstmatch=on|off flag in optimizer_switch variable.

Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -