{"id":1650,"date":"2025-05-06T11:55:55","date_gmt":"2025-05-06T02:55:55","guid":{"rendered":"https:\/\/route-zero.com\/recruit\/?post_type=route&#038;p=1650"},"modified":"2025-10-06T11:56:02","modified_gmt":"2025-10-06T02:56:02","slug":"sql%e3%83%81%e3%83%a5%e3%83%bc%e3%83%8b%e3%83%b3%e3%82%b0%e3%81%a8%e3%81%af%ef%bc%9f%e9%81%85%e3%81%84sql%e3%82%92%e6%9c%80%e7%9f%ad%e3%81%a7%e6%94%b9%e5%96%84%e3%81%99%e3%82%8b3%e3%81%a4%e3%81%ae","status":"publish","type":"route","link":"https:\/\/route-zero.com\/recruit\/route\/1650\/","title":{"rendered":"SQL\u30c1\u30e5\u30fc\u30cb\u30f3\u30b0\u3068\u306f\uff1f\u9045\u3044SQL\u3092\u6700\u77ed\u3067\u6539\u5584\u3059\u308b3\u3064\u306e\u624b\u9806"},"content":{"rendered":"<div>\n<h2>SQL\u30c1\u30e5\u30fc\u30cb\u30f3\u30b0\u3068\u306f\uff1f \u9045\u3044\u30af\u30a8\u30ea\u3092\u6700\u77ed\u3067\u6539\u5584\u3059\u308b3\u3064\u306e\u624b\u9806<\/h2>\n<p>\u300cSQL\u304c\u9045\u3044\u300d\u300c\u539f\u56e0\u304c\u5206\u304b\u3089\u306a\u3044\u300d\u2014\u2014\u305d\u3093\u306a\u72b6\u6cc1\u306b\u7126\u3063\u305f\u7d4c\u9a13\u306f\u3042\u308a\u307e\u305b\u3093\u304b\uff1f<\/p>\n<p>\u753b\u9762\u306e\u30ec\u30b9\u30dd\u30f3\u30b9\u304c\u5999\u306b\u91cd\u304f\u3001\u3069\u306e\u51e6\u7406\u304c\u30dc\u30c8\u30eb\u30cd\u30c3\u30af\u306a\u306e\u304b\u3082\u5206\u304b\u3089\u306a\u3044\u3002\u5b9f\u52d9\u3067\u300c\u52d5\u304f\u3051\u308c\u3069\u9045\u3044SQL\u300d\u306b\u60a9\u3080\u30a8\u30f3\u30b8\u30cb\u30a2\u306f\u5c11\u306a\u304f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>\u305d\u306e\u9045\u3055\u306e\u88cf\u306b\u306f\u3001<strong>\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306e\u672a\u5229\u7528<\/strong>\u3001<strong>\u7d50\u5408\u9806\u5e8f\u306e\u975e\u52b9\u7387\u5316<\/strong>\u3001\u305d\u3057\u3066<strong>\u5b9f\u884c\u8a08\u753b\u306e\u8aad\u307f\u9055\u3044<\/strong>\u306a\u3069\u3001\u8907\u6570\u306e\u8981\u56e0\u304c\u6f5c\u3093\u3067\u3044\u307e\u3059\u3002<\/p>\n<blockquote>\n<p>\n      <strong>\u7528\u8a9e\u89e3\u8aac\uff1a\u30a4\u30f3\u30c7\u30c3\u30af\u30b9<\/strong><br \/>\n      \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u5185\u306e\u7279\u5b9a\u306e\u5217\u3092\u7d20\u65e9\u304f\u691c\u7d22\u3059\u308b\u305f\u3081\u306e\u300c\u7d22\u5f15\u300d\u3002\u672c\u306e\u5dfb\u672b\u7d22\u5f15\u306e\u3088\u3046\u306a\u5f79\u5272\u3067\u3001\u6b63\u3057\u304f\u8a2d\u5b9a\u3059\u308b\u3068\u691c\u7d22\u3084\u62bd\u51fa\u304c\u9ad8\u901f\u5316\u3057\u307e\u3059\u3002\n    <\/p>\n<\/blockquote>\n<p>\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001\u305d\u3093\u306a\u300c\u9045\u3044SQL\u300d\u3092\u6539\u5584\u3059\u308b\u305f\u3081\u306e<strong>\u30c1\u30e5\u30fc\u30cb\u30f3\u30b0\u624b\u9806<\/strong>\u30923\u30b9\u30c6\u30c3\u30d7\u3067\u6574\u7406\u3057\u307e\u3059\u3002SQL\u306e\u6700\u9069\u5316\u306f\u3001\u5358\u306a\u308b\u30c6\u30af\u30cb\u30c3\u30af\u3067\u306f\u306a\u304f\u300c\u6b63\u3057\u304f\u539f\u56e0\u3092\u898b\u629c\u304f\u529b\u300d\u3002\u660e\u65e5\u304b\u3089\u306e\u958b\u767a\u73fe\u5834\u3067\u3001<strong>\u81ea\u4fe1\u3092\u6301\u3063\u3066\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u6539\u5584\u306b\u53d6\u308a\u7d44\u3081\u308b\u57fa\u790e\u529b<\/strong>\u3092\u8eab\u306b\u3064\u3051\u307e\u3057\u3087\u3046\u3002<\/p>\n<hr \/>\n<h2>SQL\u30c1\u30e5\u30fc\u30cb\u30f3\u30b0\u3068\u306f\uff1f\u76ee\u7684\u3068\u57fa\u672c\u306e\u8003\u3048\u65b9<\/h2>\n<p>SQL\u30c1\u30e5\u30fc\u30cb\u30f3\u30b0\u3068\u306f\u3001<strong>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30af\u30a8\u30ea\u306e\u5b9f\u884c\u901f\u5ea6\u3092\u6539\u5584\u3059\u308b\u305f\u3081\u306e\u6700\u9069\u5316\u30d7\u30ed\u30bb\u30b9<\/strong>\u3092\u6307\u3057\u307e\u3059\u3002\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u52d5\u4f5c\u304c\u91cd\u3044\u3068\u611f\u3058\u305f\u3068\u304d\u3001\u5b9f\u306f\u591a\u304f\u306e\u5834\u5408\u3001\u30dc\u30c8\u30eb\u30cd\u30c3\u30af\u306f\u30a2\u30d7\u30ea\u5074\u3067\u306f\u306a\u304fSQL\u3067\u3059\u3002<\/p>\n<p>\u30c1\u30e5\u30fc\u30cb\u30f3\u30b0\u306b\u3088\u3063\u3066\u6539\u5584\u3067\u304d\u308b\u6307\u6a19\u306f\u6b21\u306e3\u3064\u3067\u3059\u3002<\/p>\n<ul>\n<li>\n<p><strong>\u5fdc\u7b54\u6642\u9593\uff08\u30ec\u30b9\u30dd\u30f3\u30b9\u30bf\u30a4\u30e0\uff09<\/strong>\uff1a\u30e6\u30fc\u30b6\u30fc\u304c\u4f53\u611f\u3059\u308b\u901f\u5ea6<\/p>\n<\/li>\n<li>\n<p><strong>CPU\u4f7f\u7528\u7387\uff0fI\/O\u8ca0\u8377<\/strong>\uff1a\u30b5\u30fc\u30d0\u30fc\u8cc7\u6e90\u306e\u4f7f\u7528\u52b9\u7387<\/p>\n<\/li>\n<li>\n<p><strong>\u30b9\u30eb\u30fc\u30d7\u30c3\u30c8<\/strong>\uff1a\u5358\u4f4d\u6642\u9593\u3042\u305f\u308a\u306e\u51e6\u7406\u4ef6\u6570<\/p>\n<\/li>\n<\/ul>\n<blockquote>\n<p>\n      <strong>\u7528\u8a9e\u89e3\u8aac\uff1a\u30b9\u30eb\u30fc\u30d7\u30c3\u30c8<\/strong><br \/>\n      \u4e00\u5b9a\u6642\u9593\u5185\u306b\u51e6\u7406\u3067\u304d\u308b\u30c7\u30fc\u30bf\u91cf\u3084\u4ef6\u6570\u306e\u3053\u3068\u3002\u30b7\u30b9\u30c6\u30e0\u5168\u4f53\u306e\u51e6\u7406\u80fd\u529b\u3092\u793a\u3059\u6307\u6a19\u3067\u3059\u3002\n    <\/p>\n<\/blockquote>\n<p>SQL\u306f\u6b63\u3057\u304f\u66f8\u3051\u3070\u52d5\u304d\u307e\u3059\u304c\u3001\u300c\u901f\u304f\u52d5\u304f\u300d\u304b\u3069\u3046\u304b\u306f\u5225\u554f\u984c\u3002\u30c1\u30e5\u30fc\u30cb\u30f3\u30b0\u306e\u76ee\u7684\u306f\u3001<strong>\u540c\u3058\u7d50\u679c\u3092\u3088\u308a\u5c11\u306a\u3044\u8ca0\u8377\u3067\u8fd4\u3059\u3053\u3068<\/strong>\u306b\u3042\u308a\u307e\u3059\u3002<\/p>\n<hr \/>\n<h2>SQL\u304c\u9045\u304f\u306a\u308b\u4e3b\u306a3\u3064\u306e\u539f\u56e0<\/h2>\n<h3>\u2460 \u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u304c\u52b9\u3044\u3066\u3044\u306a\u3044<\/h3>\n<p>SQL\u3092\u9ad8\u901f\u5316\u3059\u308b\u6700\u3082\u57fa\u672c\u7684\u306a\u624b\u6cd5\u304c<strong>\u30a4\u30f3\u30c7\u30c3\u30af\u30b9<\/strong>\u3067\u3059\u3002\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306f\u66f8\u7c4d\u306e\u7d22\u5f15\u306e\u3088\u3046\u306a\u3082\u306e\u3067\u3001\u7279\u5b9a\u306e\u5217\u3092\u7d20\u65e9\u304f\u691c\u7d22\u3059\u308b\u305f\u3081\u306e\u4ed5\u7d44\u307f\u3067\u3059\u3002<\/p>\n<p>\u3057\u304b\u3057\u3001\u6b21\u306e\u3088\u3046\u306a\u30b1\u30fc\u30b9\u3067\u306f\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u304c\u7121\u52b9\u5316\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre><code>SELECT * FROM users WHERE LOWER(name) = 'sato';\r\n<\/code><\/pre>\n<p>\u3053\u306e\u3088\u3046\u306b<strong>\u95a2\u6570\u3092\u304b\u3051\u305f\u5217<\/strong>\u3067\u306f\u3001\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u304c\u5229\u7528\u3055\u308c\u305a<strong>\u30d5\u30eb\u30b9\u30ad\u30e3\u30f3<\/strong>\uff08\u5168\u4ef6\u8d70\u67fb\uff09\u306b\u306a\u308a\u307e\u3059\u3002\u5bfe\u5fdc\u7b56\u3068\u3057\u3066\u3001\u5fc5\u8981\u306b\u5fdc\u3058\u3066<strong>\u95a2\u6570\u30a4\u30f3\u30c7\u30c3\u30af\u30b9<\/strong>\u3084<strong>\u6b63\u898f\u5316\u6e08\u307f\u5217<\/strong>\u3092\u6d3b\u7528\u3059\u308b\u306e\u304c\u5b9a\u77f3\u3067\u3059\u3002<\/p>\n<blockquote>\n<p>\n      <strong>\u7528\u8a9e\u89e3\u8aac\uff1a\u30d5\u30eb\u30b9\u30ad\u30e3\u30f3<\/strong><br \/>\n      \u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u4f7f\u308f\u305a\u3001\u30c6\u30fc\u30d6\u30eb\u5185\u306e\u5168\u30c7\u30fc\u30bf\u3092\u6700\u521d\u304b\u3089\u6700\u5f8c\u307e\u3067\u8abf\u3079\u308b\u51e6\u7406\u3002\u5927\u91cf\u30c7\u30fc\u30bf\u3067\u306f\u51e6\u7406\u304c\u9045\u304f\u306a\u308a\u307e\u3059\u3002\n    <\/p>\n<p>\n      <strong>\u7528\u8a9e\u89e3\u8aac\uff1a\u95a2\u6570\u30a4\u30f3\u30c7\u30c3\u30af\u30b9<\/strong><br \/>\n      \u5217\u306b\u95a2\u6570\uff08\u4f8b\uff1aLOWER\u306a\u3069\uff09\u3092\u9069\u7528\u3057\u305f\u7d50\u679c\u306b\u5bfe\u3057\u3066\u4f5c\u6210\u3059\u308b\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3002\u7279\u5b9a\u306e\u691c\u7d22\u6761\u4ef6\u3067\u3082\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u304c\u52b9\u304f\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002\n    <\/p>\n<\/blockquote>\n<p>\uff08\u30c7\u30fc\u30bf\u578b\u306e\u9055\u3044\u306b\u3088\u308b\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u5dee\u306b\u3064\u3044\u3066\u306f\u300e<a href=\"https:\/\/route-zero.com\/recruit\/route\/1349\/\">\u3010SQL\u3011CHAR\u3068VARCHAR\u306e\u9055\u3044\u3068\u306f\uff1f\u300c\u7a7a\u767d\u304c\u57cb\u307e\u308b\u300d\u300c\u6587\u5b57\u304c\u5207\u308c\u308b\u300d\u3088\u304f\u3042\u308b\u3064\u307e\u305a\u304d\u3092\u5fb9\u5e95\u89e3\u8aac<\/a>\u300f\u3092\u3054\u53c2\u7167\u304f\u3060\u3055\u3044\uff09<\/p>\n<hr \/>\n<h3>\u2461 \u7d50\u5408\uff08JOIN\uff09\u306e\u9806\u5e8f\u30fb\u6761\u4ef6\u304c\u975e\u52b9\u7387<\/h3>\n<p>\u591a\u30c6\u30fc\u30d6\u30ebJOIN\u3067\u306f\u3001\u7d50\u5408\u9806\u5e8f\u3084\u7d50\u5408\u6761\u4ef6\u304c\u51e6\u7406\u901f\u5ea6\u3092\u5927\u304d\u304f\u5de6\u53f3\u3057\u307e\u3059\u3002<\/p>\n<pre><code>SELECT o.id, u.name\r\nFROM orders o\r\nJOIN users u ON o.user_id = u.id\r\nWHERE u.age > 30;\r\n<\/code><\/pre>\n<p>\u4e0a\u8a18\u3067\u306f\u3001<code>users<\/code>\u304c\u5148\u306b\u7d5e\u308a\u8fbc\u307e\u308c\u3066\u3044\u306a\u3044\u3068\u3001\u4e0d\u8981\u306a\u7d50\u5408\u51e6\u7406\u304c\u5927\u91cf\u306b\u8d70\u308a\u307e\u3059\u3002<strong>\u5c0f\u3055\u3044\u30c6\u30fc\u30d6\u30eb\u304b\u3089\u7d50\u5408\u3059\u308b<\/strong>\u3001<strong>WHERE\u53e5\u3067\u5148\u306b\u7d5e\u308a\u8fbc\u3080<\/strong>\u306a\u3069\u306e\u9806\u5e8f\u6700\u9069\u5316\u304c\u91cd\u8981\u3067\u3059\u3002<\/p>\n<blockquote>\n<p>\n      <strong>\u7528\u8a9e\u89e3\u8aac\uff1a\u7d50\u5408\uff08JOIN\uff09<\/strong><br \/>\n      \u8907\u6570\u306e\u30c6\u30fc\u30d6\u30eb\u3092\u95a2\u9023\u4ed8\u3051\u3066\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3059\u308b\u64cd\u4f5c\u3002\u4f8b\u3048\u3070\u300c\u6ce8\u6587\u300d\u3068\u300c\u30e6\u30fc\u30b6\u30fc\u300d\u30c6\u30fc\u30d6\u30eb\u3092\u3064\u306a\u3052\u3066\u4e00\u89a7\u8868\u793a\u3059\u308b\u5834\u5408\u306a\u3069\u306b\u4f7f\u3044\u307e\u3059\u3002\n    <\/p>\n<p>\n      <strong>\u7528\u8a9e\u89e3\u8aac\uff1a\u7d50\u5408\u9806\u5e8f<\/strong><br \/>\n      \u8907\u6570\u30c6\u30fc\u30d6\u30eb\u3092JOIN\u3059\u308b\u969b\u3001\u3069\u306e\u30c6\u30fc\u30d6\u30eb\u304b\u3089\u51e6\u7406\u3092\u59cb\u3081\u308b\u304b\u306e\u9806\u756a\u3002\u52b9\u7387\u7684\u306a\u9806\u5e8f\u3092\u9078\u3076\u3053\u3068\u3067SQL\u306e\u901f\u5ea6\u304c\u5927\u304d\u304f\u5909\u308f\u308a\u307e\u3059\u3002\n    <\/p>\n<\/blockquote>\n<p>\uff08JOIN\u306e\u7a2e\u985e\u3084\u4f7f\u3044\u5206\u3051\u306b\u3064\u3044\u3066\u306f\u300e<a href=\"https:\/\/route-zero.com\/recruit\/route\/1119\/\">SQL JOIN\u306e\u57fa\u672c\u304b\u3089\u5b9f\u8df5\u307e\u3067\uff5cINNER\u30fbLEFT\u30fbRIGHT\u30fbOUTER JOIN\u306e\u9055\u3044\u3092\u308f\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac<\/a>\u300f\u3092\u3054\u53c2\u7167\u304f\u3060\u3055\u3044\uff09<\/p>\n<hr \/>\n<h3>\u2462 \u5b9f\u884c\u8a08\u753b\u306e\u30dc\u30c8\u30eb\u30cd\u30c3\u30af<\/h3>\n<p>SQL\u304c\u3069\u306e\u3088\u3046\u306b\u51e6\u7406\u3055\u308c\u3066\u3044\u308b\u304b\u3092\u77e5\u308b\u305f\u3081\u306b\u4f7f\u3046\u306e\u304c<strong>\u5b9f\u884c\u8a08\u753b\uff08EXPLAIN\uff09<\/strong>\u3067\u3059\u3002<\/p>\n<pre><code>EXPLAIN SELECT * FROM users WHERE id = 100;\r\n<\/code><\/pre>\n<p>\u5b9f\u884c\u8a08\u753b\u3092\u8aad\u3080\u3053\u3068\u3067\u3001<strong>\u30c6\u30fc\u30d6\u30eb\u30b9\u30ad\u30e3\u30f3\u30fb\u7d50\u5408\u9806\u5e8f\u30fb\u30b3\u30b9\u30c8\u5024<\/strong>\u3092\u628a\u63e1\u3067\u304d\u307e\u3059\u3002\u7279\u306b<code>COST<\/code>\u5024\u304c\u9ad8\u3044\u51e6\u7406\uff08\u4f8b\uff1aSeq Scan\uff09\u306f\u30dc\u30c8\u30eb\u30cd\u30c3\u30af\u306e\u30b5\u30a4\u30f3\u3067\u3059\u3002SQL\u3092\u901f\u304f\u3059\u308b\u7b2c\u4e00\u6b69\u306f\u3001<strong>\u5b9f\u884c\u8a08\u753b\u3092\u8aad\u307f\u89e3\u304f\u7fd2\u6163<\/strong>\u3092\u6301\u3064\u3053\u3068\u3067\u3059\u3002<\/p>\n<blockquote>\n<p>\n      <strong>\u7528\u8a9e\u89e3\u8aac\uff1a\u5b9f\u884c\u8a08\u753b\uff08EXPLAIN\uff09<\/strong><br \/>\n      SQL\u304c\u3069\u306e\u3088\u3046\u306a\u624b\u9806\u3067\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3059\u308b\u304b\u3092\u793a\u3059\u5206\u6790\u7d50\u679c\u3002EXPLAIN\u30b3\u30de\u30f3\u30c9\u3067\u78ba\u8a8d\u3067\u304d\u3001\u30dc\u30c8\u30eb\u30cd\u30c3\u30af\u7279\u5b9a\u306b\u5f79\u7acb\u3061\u307e\u3059\u3002\n    <\/p>\n<p>\n      <strong>\u7528\u8a9e\u89e3\u8aac\uff1a\u30c6\u30fc\u30d6\u30eb\u30b9\u30ad\u30e3\u30f3<\/strong><br \/>\n      \u30c6\u30fc\u30d6\u30eb\u5168\u4f53\u3092\u6700\u521d\u304b\u3089\u6700\u5f8c\u307e\u3067\u8abf\u3079\u308b\u51e6\u7406\u3002\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u304c\u4f7f\u308f\u308c\u3066\u3044\u306a\u3044\u5834\u5408\u306b\u767a\u751f\u3057\u3084\u3059\u3044\u3067\u3059\u3002\n    <\/p>\n<p>\n      <strong>\u7528\u8a9e\u89e3\u8aac\uff1a\u30b3\u30b9\u30c8\u5024<\/strong><br \/>\n      \u5b9f\u884c\u8a08\u753b\u3067\u8868\u793a\u3055\u308c\u308b\u300c\u51e6\u7406\u306e\u91cd\u3055\u300d\u3092\u793a\u3059\u6570\u5024\u3002\u5024\u304c\u5927\u304d\u3044\u307b\u3069\u8ca0\u8377\u304c\u9ad8\u3044\u51e6\u7406\u3068\u5224\u65ad\u3067\u304d\u307e\u3059\u3002\n    <\/p>\n<\/blockquote>\n<p>\uff08\u30b5\u30d6\u30af\u30a8\u30ea\u3084CTE\u306e\u4f7f\u3044\u5206\u3051\u30fb\u9ad8\u901f\u5316\u306b\u3064\u3044\u3066\u306f\u300e<a href=\"https:\/\/route-zero.com\/recruit\/route\/1594\/\">SQL\u30b5\u30d6\u30af\u30a8\u30ea\u306f\u9045\u3044\uff1fJOIN\u30fbCTE\u3068\u306e\u9055\u3044\u3068\u9ad8\u901f\u5316\u306e\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9<\/a>\u300f\u3092\u3054\u53c2\u7167\u304f\u3060\u3055\u3044\uff09<\/p>\n<hr \/>\n<h2>\u5b9f\u8df5\u30b9\u30c6\u30c3\u30d7\uff1aSQL\u30c1\u30e5\u30fc\u30cb\u30f3\u30b0\u306e\u57fa\u672c\u624b\u9806<\/h2>\n<h3>STEP1\uff1a\u30b9\u30ed\u30fc\u30af\u30a8\u30ea\u30ed\u30b0\u3067\u30dc\u30c8\u30eb\u30cd\u30c3\u30af\u3092\u7279\u5b9a<\/h3>\n<p>\u307e\u305a\u3001<strong>\u9045\u3044SQL\u3092\u7279\u5b9a\u3059\u308b<\/strong>\u3053\u3068\u304b\u3089\u59cb\u3081\u307e\u3059\u3002MySQL\u3067\u306f\u3001\u4ee5\u4e0b\u306e\u8a2d\u5b9a\u30671\u79d2\u4ee5\u4e0a\u304b\u304b\u308b\u30af\u30a8\u30ea\u3092\u8a18\u9332\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre><code>SET GLOBAL slow_query_log = 1;\r\nSET GLOBAL long_query_time = 1;\r\n<\/code><\/pre>\n<p>\u30b9\u30ed\u30fc\u30af\u30a8\u30ea\u30ed\u30b0\u304b\u3089\u3001<strong>\u3069\u306eSQL\u304c\u6642\u9593\u3092\u8981\u3057\u3066\u3044\u308b\u304b<\/strong>\u3092\u6d17\u3044\u51fa\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<blockquote>\n<p>\n      <strong>\u7528\u8a9e\u89e3\u8aac\uff1a\u30b9\u30ed\u30fc\u30af\u30a8\u30ea\u30ed\u30b0<\/strong><br \/>\n      \u4e00\u5b9a\u6642\u9593\u4ee5\u4e0a\u304b\u304b\u3063\u305f\u9045\u3044SQL\u3092\u81ea\u52d5\u7684\u306b\u8a18\u9332\u3059\u308b\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u6a5f\u80fd\u3002\u3069\u306e\u30af\u30a8\u30ea\u304c\u30dc\u30c8\u30eb\u30cd\u30c3\u30af\u304b\u3092\u7279\u5b9a\u3067\u304d\u307e\u3059\u3002\n    <\/p>\n<\/blockquote>\n<hr \/>\n<h3>STEP2\uff1aEXPLAIN\u3067\u5b9f\u884c\u8a08\u753b\u3092\u78ba\u8a8d<\/h3>\n<p>\u7279\u5b9a\u3057\u305fSQL\u3092<code>EXPLAIN<\/code>\u3067\u89e3\u6790\u3057\u307e\u3059\u3002\u51fa\u529b\u7d50\u679c\u306e\u4e2d\u3067\u6ce8\u76ee\u3059\u3079\u304d\u306f\u4ee5\u4e0b\u306e3\u70b9\u3067\u3059\u3002<\/p>\n<table>\n<thead>\n<tr>\n<th>\u9805\u76ee<\/th>\n<th>\u610f\u5473<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><strong>type<\/strong><\/td>\n<td>\u30a2\u30af\u30bb\u30b9\u65b9\u6cd5\uff08ALL\u306f\u30d5\u30eb\u30b9\u30ad\u30e3\u30f3\uff09<\/td>\n<\/tr>\n<tr>\n<td><strong>key<\/strong><\/td>\n<td>\u4f7f\u7528\u4e2d\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u540d<\/td>\n<\/tr>\n<tr>\n<td><strong>rows<\/strong><\/td>\n<td>\u51e6\u7406\u5bfe\u8c61\u306e\u884c\u6570\uff08\u76ee\u5b89\uff09<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><code>type=ALL<\/code>\u304b\u3064<code>rows<\/code>\u304c\u591a\u3044\u5834\u5408\u3001<strong>\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u672a\u4f7f\u7528<\/strong>\u306e\u53ef\u80fd\u6027\u304c\u9ad8\u3044\u3067\u3059\u3002<\/p>\n<hr \/>\n<h3>STEP3\uff1a\u4fee\u6b63\u5f8c\u306e\u52b9\u679c\u3092\u6570\u5024\u3067\u6bd4\u8f03<\/h3>\n<p>\u4fee\u6b63\u3057\u305fSQL\u3092\u518d\u5ea6<code>EXPLAIN ANALYZE<\/code>\u3084\u8a08\u6e2c\u30c4\u30fc\u30eb\u3067\u6bd4\u8f03\u3057\u307e\u3059\u3002\u6539\u5584\u7387\u3092\u300c\u5b9f\u884c\u6642\u9593\uff08Before\uff0fAfter\uff09\u300d\u3067\u8a18\u9332\u3059\u308b\u3053\u3068\u3067\u3001<strong>\u30c1\u30e5\u30fc\u30cb\u30f3\u30b0\u306e\u52b9\u679c\u3092\u5b9a\u91cf\u5316<\/strong>\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u4f8b\uff1a\u5e73\u57471.2\u79d2\u21920.3\u79d2\uff08\u7d0475%\u77ed\u7e2e\uff09<\/p>\n<p>\u6570\u5024\u3092\u8ffd\u3046\u7fd2\u6163\u304c\u3001\u6b21\u306e\u6539\u5584\u30b5\u30a4\u30af\u30eb\u306b\u6d3b\u304d\u3066\u304d\u307e\u3059\u3002<\/p>\n<hr \/>\n<h2>\u30c1\u30e5\u30fc\u30cb\u30f3\u30b0\u3092\u652f\u63f4\u3059\u308b\u4fbf\u5229\u30c4\u30fc\u30eb4\u9078<\/h2>\n<ul>\n<li>\n<p><strong>MySQL Workbench<\/strong>\uff1aGUI\u3067\u5b9f\u884c\u8a08\u753b\u3092\u53ef\u8996\u5316<\/p>\n<\/li>\n<li>\n<p><strong>pgAdmin<\/strong>\uff1aPostgreSQL\u6a19\u6e96\u306e\u5206\u6790\u30c4\u30fc\u30eb<\/p>\n<\/li>\n<li>\n<p><strong>SQL Server Profiler<\/strong>\uff1a\u30af\u30a8\u30ea\u3054\u3068\u306e\u8ca0\u8377\u3092\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u76e3\u8996<\/p>\n<\/li>\n<li>\n<p><strong>Cloud SQL Insights<\/strong>\uff1aGCP\u74b0\u5883\u3067\u306e\u7d71\u8a08\u53ef\u8996\u5316\u306b\u6700\u9069<\/p>\n<\/li>\n<\/ul>\n<blockquote>\n<p>\n      <strong>\u7528\u8a9e\u89e3\u8aac\uff1aMySQL Workbench<\/strong><br \/>\n      MySQL\u516c\u5f0f\u306e\u7ba1\u7406\u30c4\u30fc\u30eb\u3002SQL\u306e\u5b9f\u884c\u8a08\u753b\u3084\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u8a2d\u8a08\u3092GUI\u3067\u76f4\u611f\u7684\u306b\u64cd\u4f5c\u3067\u304d\u307e\u3059\u3002\n    <\/p>\n<p>\n      <strong>\u7528\u8a9e\u89e3\u8aac\uff1apgAdmin<\/strong><br \/>\n      PostgreSQL\u7528\u306e\u6a19\u6e96\u7ba1\u7406\u30c4\u30fc\u30eb\u3002\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u7ba1\u7406\u3084\u5206\u6790\u3001\u5b9f\u884c\u8a08\u753b\u306e\u78ba\u8a8d\u304c\u53ef\u80fd\u3067\u3059\u3002\n    <\/p>\n<p>\n      <strong>\u7528\u8a9e\u89e3\u8aac\uff1aSQL Server Profiler<\/strong><br \/>\n      Microsoft SQL Server\u306e\u52d5\u4f5c\u3092\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u3067\u76e3\u8996\u30fb\u5206\u6790\u3067\u304d\u308b\u30c4\u30fc\u30eb\u3002\n    <\/p>\n<p>\n      <strong>\u7528\u8a9e\u89e3\u8aac\uff1aCloud SQL Insights<\/strong><br \/>\n      Google Cloud Platform\u3067\u63d0\u4f9b\u3055\u308c\u308b\u3001SQL\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306e\u53ef\u8996\u5316\u30fb\u5206\u6790\u30c4\u30fc\u30eb\u3002\n    <\/p>\n<\/blockquote>\n<p>\u30c4\u30fc\u30eb\u3092\u4f7f\u3046\u3053\u3068\u3067\u3001<strong>\u76f4\u611f\u7684\u306b\u30dc\u30c8\u30eb\u30cd\u30c3\u30af\u3092\u53ef\u8996\u5316<\/strong>\u3067\u304d\u307e\u3059\u3002\u7279\u306bMySQL Workbench\u306f\u3001\u958b\u767a\u521d\u5fc3\u8005\u306b\u3082\u5206\u304b\u308a\u3084\u3059\u304f\u4eba\u6c17\u3067\u3059\u3002<\/p>\n<hr \/>\n<h2>\u30c8\u30e9\u30d6\u30eb\u3092\u9632\u3050\u305f\u3081\u306e\u8a2d\u8a08\u30fb\u904b\u7528\u30c1\u30a7\u30c3\u30af\u30ea\u30b9\u30c8<\/h2>\n<p>SQL\u30c1\u30e5\u30fc\u30cb\u30f3\u30b0\u306f\u300c\u4fee\u6b63\u300d\u3060\u3051\u3067\u306a\u304f\u3001\u300c\u9632\u3050\u300d\u3053\u3068\u3082\u91cd\u8981\u3067\u3059\u3002\u4ee5\u4e0b\u306e3\u70b9\u3092\u5b9a\u671f\u7684\u306b\u30c1\u30a7\u30c3\u30af\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<ol>\n<li>\n<p><strong>\u30c7\u30fc\u30bf\u91cf\u5897\u52a0\u3092\u60f3\u5b9a\u3057\u305f\u8a2d\u8a08\u306b\u306a\u3063\u3066\u3044\u308b\u304b<\/strong><br \/>\u2192 WHERE\u53e5\u306e\u30ab\u30e9\u30e0\u306b\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u8a2d\u5b9a\u6e08\u307f\u304b\u78ba\u8a8d\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u30d0\u30c3\u30c1\u51e6\u7406\u3084\u96c6\u8a08\u30af\u30a8\u30ea\u304c\u696d\u52d9\u6642\u9593\u306b\u8d70\u3063\u3066\u3044\u306a\u3044\u304b<\/strong><br \/>\u2192 \u30b9\u30b1\u30b8\u30e5\u30fc\u30eb\u8abf\u6574\u3067DB\u8ca0\u8377\u3092\u5e73\u6e96\u5316\u3002<\/p>\n<\/li>\n<li>\n<p><strong>\u30c6\u30b9\u30c8\u74b0\u5883\u3067\u8ca0\u8377\u691c\u8a3c\u3092\u3057\u3066\u3044\u308b\u304b<\/strong><br \/>\u2192 \u5b9f\u30c7\u30fc\u30bf\u91cf\u3092\u60f3\u5b9a\u3057\u305f\u30c6\u30b9\u30c8\u3067\u4e8b\u524d\u306b\u691c\u8a3c\u3002<\/p>\n<\/li>\n<\/ol>\n<p>\u8a2d\u8a08\u6bb5\u968e\u304b\u3089\u30c1\u30e5\u30fc\u30cb\u30f3\u30b0\u3092\u610f\u8b58\u3059\u308b\u3053\u3068\u3067\u3001<strong>\u904b\u7528\u30c8\u30e9\u30d6\u30eb\u306e8\u5272\u3092\u9632\u3052\u307e\u3059<\/strong>\u3002<\/p>\n<hr \/>\n<h2>FAQ\uff08\u629c\u7c8b\uff09<\/h2>\n<p><strong>Q1. SQL\u30c1\u30e5\u30fc\u30cb\u30f3\u30b0\u306f\u521d\u5fc3\u8005\u3067\u3082\u3067\u304d\u307e\u3059\u304b\uff1f<\/strong><br \/>\u2192 \u53ef\u80fd\u3067\u3059\u3002\u307e\u305a\u306f<code>EXPLAIN<\/code>\u306e\u898b\u65b9\u3092\u7406\u89e3\u3059\u308b\u3068\u3053\u308d\u304b\u3089\u59cb\u3081\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><strong>Q2. \u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306f\u591a\u3044\u307b\u3069\u901f\u304f\u306a\u308a\u307e\u3059\u304b\uff1f<\/strong><br \/>\u2192 \u3044\u3044\u3048\u3002INSERT\/UPDATE\u6642\u306e\u8ca0\u8377\u304c\u5897\u3048\u308b\u305f\u3081\u3001\u5fc5\u8981\u6700\u5c0f\u9650\u304c\u7406\u60f3\u3067\u3059\u3002<\/p>\n<p><strong>Q3. PostgreSQL\u3068MySQL\u3067\u624b\u6cd5\u306f\u9055\u3044\u307e\u3059\u304b\uff1f<\/strong><br \/>\u2192 \u57fa\u672c\u539f\u5247\u306f\u540c\u3058\u3067\u3059\u304c\u3001\u7d71\u8a08\u60c5\u5831\u306e\u6271\u3044\u65b9\u3084EXPLAIN\u51fa\u529b\u5f62\u5f0f\u306b\u5dee\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<hr \/>\n<h2>\u307e\u3068\u3081\uff1a\u539f\u56e0\u3092\u898b\u629c\u304f\u529b\u304c\u201c\u901f\u3044SQL\u201d\u3092\u751f\u3080<\/h2>\n<p>SQL\u30c1\u30e5\u30fc\u30cb\u30f3\u30b0\u306e\u672c\u8cea\u306f\u3001<strong>\u30c6\u30af\u30cb\u30c3\u30af\u3088\u308a\u3082\u5206\u6790\u529b<\/strong>\u306b\u3042\u308a\u307e\u3059\u3002\u300c\u306a\u305c\u9045\u3044\u306e\u304b\u300d\u3092\u7406\u89e3\u3057\u3001\u5b9f\u884c\u8a08\u753b\u3092\u6839\u62e0\u306b\u6539\u5584\u3092\u91cd\u306d\u308b\u3053\u3068\u3067\u3001\u30b7\u30b9\u30c6\u30e0\u5168\u4f53\u306e\u4fe1\u983c\u6027\u3068\u30b9\u30b1\u30fc\u30e9\u30d3\u30ea\u30c6\u30a3\u304c\u5411\u4e0a\u3057\u307e\u3059\u3002<\/p>\n<p>\u4eca\u3059\u3050\u3067\u304d\u308b\u7b2c\u4e00\u6b69\u306f\u3001\u30b9\u30ed\u30fc\u30af\u30a8\u30ea\u30ed\u30b0\u306e\u78ba\u8a8d\u3068EXPLAIN\u306e\u5b9f\u884c\u3067\u3059\u3002\u4e00\u3064\u3072\u3068\u3064\u306e\u30af\u30a8\u30ea\u6539\u5584\u304c\u3001\u3042\u306a\u305f\u306e\u8a2d\u8a08\u529b\u3068\u958b\u767a\u751f\u7523\u6027\u3092\u78ba\u5b9f\u306b\u9ad8\u3081\u307e\u3059\u3002<\/p>\n<p>\u305c\u3072\u3001\u81ea\u8eab\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u3082\u4eca\u65e5\u7d39\u4ecb\u3057\u305f\u624b\u9806\u3092\u5b9f\u8df5\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<\/div>\n","protected":false},"featured_media":1651,"template":"","_links":{"self":[{"href":"https:\/\/route-zero.com\/recruit\/wp-json\/wp\/v2\/route\/1650"}],"collection":[{"href":"https:\/\/route-zero.com\/recruit\/wp-json\/wp\/v2\/route"}],"about":[{"href":"https:\/\/route-zero.com\/recruit\/wp-json\/wp\/v2\/types\/route"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/route-zero.com\/recruit\/wp-json\/wp\/v2\/media\/1651"}],"wp:attachment":[{"href":"https:\/\/route-zero.com\/recruit\/wp-json\/wp\/v2\/media?parent=1650"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}