mysql explain in a union query -


After explaining a query:

  Select the name from T1 where the name All selected names by name '% Smthing%' are from T2 where the name '% smthing%' will be named by the name '% smthing%' by the name of 'UNIAS All' name where the name '% smthing%' is named by Union All Selected Name T4, where names like '% smthing%'  

  ID select_type table type possible_keys key key_len referee rows additional 1 primary t1 index (zero) name 152 (zero) < / Pre> 

337 where To use; Use index 2 UNION T2 INDEX (NULL) name 152 (NULL) 3842 where to use; Use index 3 Union T3 Index (NULL) name 452 (faucet) 204 where to use; Use index 4 Union T4 Index (NULL) name 452 (faucet) 8269 where to use; The result of the index (NULL) union & lt; Union1,2,3,4 & gt; Each component of the union is explained, then the type is "index", however, the result of the union is "ALL". What is the reason for this behavior? Thanks

UNION ALL instead of UNION Try - MySQL will try to remove any duplicate rows (possibly abusive in the loan table because it is seeing the result set).

In addition, do you have the result of the union on ORDER BY Or WHERE clause? Again, it will be done on the result set, instead of table level.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -