Skip to content

Instantly share code, notes, and snippets.

@MozyOk
Created May 31, 2019 02:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MozyOk/404360ebbada03ddfe75dac7b4506ec1 to your computer and use it in GitHub Desktop.
Save MozyOk/404360ebbada03ddfe75dac7b4506ec1 to your computer and use it in GitHub Desktop.
SQLのコスト見積もり 参考: https://thinkit.co.jp/article/9658

SQL実行計画の疑問解決には「とりあえず EXPLAIN しよう

ex)

EXPLAIN select
	*
from users as us
INNER JOIN user_oauths as uo
	on us.id = uo.user_id
INNER JOIN prefectures as pf
	on us.prefecture_id = pf.id
group by us.id
order by us.id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment