Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
user_id が INT であるテーブル
理由:
SELECT * FROM tableName where user_id = 63
代わりに推奨
SELECT * FROM tableName where user_id = '63'
場合によっては、少なくとも以前のmysqlバージョンでは、mysqlが式の左側(列)を整数の右側ではなく文字列にキャストすることがありました。
これにより、インデックスを使用する代わりに、予期しないフルスキャンが発生します。
私はそれが単に意味をなさないとさえ言及しません。