Skip to content

Instantly share code, notes, and snippets.

@haruta
Created March 29, 2013 10:04
Show Gist options
  • Save haruta/5270002 to your computer and use it in GitHub Desktop.
Save haruta/5270002 to your computer and use it in GitHub Desktop.
mysql> desc (SELECT * FROM users WHERE email_pc='[email protected]' AND deleted=0) UNION (SELECT * FROM users WHERE email_mobile='[email protected]' AND deleted=0) \G
*************************** 1. row ***************************
id: 1
select_type: PRIMARY
table: users
type: const
possible_keys: email_pc
key: email_pc
key_len: 264
ref: const,const
rows: 1
Extra:
*************************** 2. row ***************************
id: 2
select_type: UNION
table: NULL
type: NULL
possible_keys: NULL
key: NULL
key_len: NULL
ref: NULL
rows: NULL
Extra: Impossible WHERE noticed after reading const tables
*************************** 3. row ***************************
id: NULL
select_type: UNION RESULT
table: <union1,2>
type: ALL
possible_keys: NULL
key: NULL
key_len: NULL
ref: NULL
rows: NULL
Extra:
3 rows in set (0.00 sec)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment