{"id":4204,"date":"2017-11-12T14:08:59","date_gmt":"2017-11-12T22:08:59","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/?p=4204"},"modified":"2025-06-13T20:20:14","modified_gmt":"2025-06-14T03:20:14","slug":"create-right-index-get-right-performance","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/ko\/create-right-index-get-right-performance\/","title":{"rendered":"\uc62c\ubc14\ub978 \uc778\ub371\uc2a4\ub97c \uc0dd\uc131\ud558\uace0 \uc62c\ubc14\ub978 \uc131\uacfc\ub97c \uc5bb\uc73c\uc138\uc694."},"content":{"rendered":"<h2><b>\uc18c\uac1c<\/b><\/h2>\n<p><span style=\"font-weight: 400\">\ub370\uc774\ud130\ubca0\uc774\uc2a4 \uc2dc\uc2a4\ud15c\uc5d0\ub294 \uc138 \uac00\uc9c0 \uc911\uc694\ud55c \uc0ac\ud56d\uc774 \uc788\uc2b5\ub2c8\ub2e4:<\/span><a href=\"https:\/\/sigmod.org\/publications\/interviews\/pdf\/p71-column-winslet.pdf\"> <span style=\"font-weight: 400\">\uc131\ub2a5, \uc131\ub2a5, \uc131\ub2a5.<\/span><\/a><span style=\"font-weight: 400\"> NoSQL \ub370\uc774\ud130\ubca0\uc774\uc2a4 \uc2dc\uc2a4\ud15c\uc5d0\ub294 \uc138 \uac00\uc9c0 \uc911\uc694\ud55c \uc0ac\ud56d\uc774 \uc788\uc2b5\ub2c8\ub2e4: <strong>\uaddc\ubaa8\uc5d0 \ub9de\ub294 \uc131\ub2a5, \uaddc\ubaa8\uc5d0 \ub9de\ub294 \uc131\ub2a5, \uaddc\ubaa8\uc5d0 \ub9de\ub294 \uc131\ub2a5<\/strong>.<\/span><\/p>\n<p><span style=\"font-weight: 400\">\uc778\ub371\uc2a4 \uc635\uc158\uc744 \uc774\ud574\ud558\uace0, \uc62c\ubc14\ub978 \ud0a4, \uc62c\ubc14\ub978 \uc21c\uc11c, \uc62c\ubc14\ub978 \ud45c\ud604\uc2dd\uc744 \uc0ac\uc6a9\ud558\uc5ec \uc62c\ubc14\ub978 \uc778\ub371\uc2a4\ub97c \uc0dd\uc131\ud558\ub294 \uac83\uc740 Couchbase\uc5d0\uc11c \ucffc\ub9ac \uc131\ub2a5\uacfc \uaddc\ubaa8\uc5d0 \ub9de\ub294 \uc131\ub2a5\uc744 \ubc1c\ud718\ud558\ub294 \ub370 \ub9e4\uc6b0 \uc911\uc694\ud569\ub2c8\ub2e4. <\/span><span style=\"font-weight: 400\">\ub2e4\uc74c \uc0ac\ud56d\uc5d0 \ub300\ud574 \ub17c\uc758\ud588\uc2b5\ub2c8\ub2e4.<\/span><a href=\"https:\/\/planetnosql.blogspot.com\/2016\/06\/keep-calm-and-json.html\"> <span style=\"font-weight: 400\">JSON\uc6a9 \ub370\uc774\ud130 \ubaa8\ub378\ub9c1<\/span><\/a><span style=\"font-weight: 400\"> \uadf8\ub9ac\uace0<\/span><a href=\"https:\/\/planetnosql.blogspot.com\/2016\/07\/keep-calm-and-query-json.html\"> <span style=\"font-weight: 400\">JSON \ucffc\ub9ac<\/span><\/a><span style=\"font-weight: 400\"> \uc5d0 \ub300\ud574 \uc124\uba85\ud588\uc2b5\ub2c8\ub2e4. \uc774 \uae00\uc5d0\uc11c\ub294 Couchbase\uc5d0\uc11c JSON\uc5d0 \ub300\ud55c \uc778\ub371\uc2f1 \uc635\uc158\uc5d0 \ub300\ud574 \uc124\uba85\ud569\ub2c8\ub2e4.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Couchbase 5.0\uc5d0\ub294 \uc138 \uac00\uc9c0 \uc720\ud615\uc758 \uc778\ub371\uc2a4 \uce74\ud14c\uace0\ub9ac\uac00 \uc788\uc2b5\ub2c8\ub2e4. \uac01 \uce74\uc6b0\uce58\ubca0\uc774\uc2a4 \ud074\ub7ec\uc2a4\ud130\ub294 \ud45c\uc900 \uae00\ub85c\ubc8c \ubcf4\uc870 \uc778\ub371\uc2a4 \ub610\ub294 \uba54\ubaa8\ub9ac\uc5d0 \ucd5c\uc801\ud654\ub41c \uae00\ub85c\ubc8c \ubcf4\uc870 \uc778\ub371\uc2a4 \uc911 \ud558\ub098\uc758 \uc778\ub371\uc2a4 \uce74\ud14c\uace0\ub9ac\ub9cc \uac00\uc9c8 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<table>\n<tbody>\n<tr>\n<td><span style=\"font-weight: 400\">\ud45c\uc900 \ubcf4\uc870: \ub9b4\ub9ac\uc2a4 4.0 \uc774\uc0c1<\/span><\/td>\n<td>\n<ul>\n<li><span style=\"font-weight: 400\">ForestDB \uae30\ubc18<\/span><\/li>\n<li>Couchbase 4.0\uacfc \ud568\uaed8 \ucd9c\uc2dc<\/li>\n<\/ul>\n<\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">\uba54\ubaa8\ub9ac \ucd5c\uc801\ud654 \uc9c0\uc218: 4.5 \uc774\uc0c1<\/span><\/td>\n<td>\n<ul>\n<li><span style=\"font-weight: 400\">\uc778\ub371\uc2a4\uc758 100%\uac00 \uba54\ubaa8\ub9ac\uc5d0 \uc788\uc2b5\ub2c8\ub2e4.<\/span><\/li>\n<li>\uc778\ub371\uc2a4\ub294 \ubcf5\uad6c\uc6a9\uc73c\ub85c\ub9cc \ub514\uc2a4\ud06c\uc5d0 \uae30\ub85d\ub429\ub2c8\ub2e4.<\/li>\n<li><span style=\"font-weight: 400\">\uc608\uce21 \uac00\ub2a5\ud55c \uc131\ub2a5<\/span><\/li>\n<li><span style=\"font-weight: 400\">\ub354 \ub098\uc740 \ubcc0\uc774\uc728<\/span><\/li>\n<\/ul>\n<\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">\ud45c\uc900 \ubcf4\uc870: \ub9b4\ub9ac\uc2a4 5.0<\/span><\/td>\n<td>\n<ul>\n<li><span style=\"font-weight: 400\">\uc5d4\ud130\ud504\ub77c\uc774\uc988 \uc5d0\ub514\uc158\uc5d0 \uc7a0\uae08 \uc5c6\ub294 \uc2a4\ud0b5\ub9ac\uc2a4\ud2b8 \uae30\ubc18 Plasma \uc2a4\ud1a0\ub9ac\uc9c0 \uc5d4\uc9c4\uc744 \uc0ac\uc6a9\ud569\ub2c8\ub2e4.<\/span><\/li>\n<li>\ucee4\ubba4\ub2c8\ud2f0 \uc5d0\ub514\uc158\uc5d0 ForestDB \uc2a4\ud1a0\ub9ac\uc9c0 \uc5d4\uc9c4 \uc0ac\uc6a9<\/li>\n<li><span style=\"font-weight: 400\">Couchbase 5.0\uacfc \ud568\uaed8 \ucd9c\uc2dc\ub418\uc5c8\uc2b5\ub2c8\ub2e4.<\/span><\/li>\n<li><span style=\"font-weight: 400\">\ub9e4\uc6b0 \ud070 \ub370\uc774\ud130 \uc138\ud2b8\ub97c \ucc98\ub9ac\ud558\ub3c4\ub85d \uc124\uacc4<\/span><\/li>\n<\/ul>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"font-weight: 400\">\ud45c\uc900 \ubcf4\uc870 \uc778\ub371\uc2a4(4.0\ubd80\ud130 4.6.x\uae4c\uc9c0) \uc800\uc7a5\uc18c\ub294 ForestDB \uc2a4\ud1a0\ub9ac\uc9c0 \uc5d4\uc9c4\uc744 \uc0ac\uc6a9\ud574 B-Tree \uc778\ub371\uc2a4\ub97c \uc800\uc7a5\ud558\uace0 \ubc84\ud37c\uc5d0 \ucd5c\uc801\uc758 \uc791\uc5c5 \ub370\uc774\ud130 \uc138\ud2b8\ub97c \uc720\uc9c0\ud569\ub2c8\ub2e4. \uc989, \uc778\ub371\uc2a4\uc758 \ucd1d \ud06c\uae30\ub294 \uac01 \uc778\ub371\uc2a4 \ub178\ub4dc\uc5d0\uc11c \uc0ac\uc6a9 \uac00\ub2a5\ud55c \uba54\ubaa8\ub9ac \uc591\ubcf4\ub2e4 \ud6e8\uc52c \ud074 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<p><span style=\"font-weight: 400\">\uba54\ubaa8\ub9ac \ucd5c\uc801\ud654 \uc778\ub371\uc2a4\ub294 \uc0c8\ub85c\uc6b4 \uc7a0\uae08 \uc5c6\ub294 \uc2a4\ud0b5\ub9ac\uc2a4\ud2b8\ub97c \uc0ac\uc6a9\ud574 \uc778\ub371\uc2a4\ub97c \uc720\uc9c0\ud558\uace0 \uc778\ub371\uc2a4 \ub370\uc774\ud130\uc758 100%\ub97c \uba54\ubaa8\ub9ac\uc5d0 \ubcf4\uad00\ud569\ub2c8\ub2e4. \uba54\ubaa8\ub9ac \ucd5c\uc801\ud654 \uc778\ub371\uc2a4(MOI)\ub294 \uc778\ub371\uc2a4 \uc2a4\uce94 \ub300\uae30 \uc2dc\uac04\uc774 \ub354 \uc9e7\uace0 \ub370\uc774\ud130\uc758 \ubcc0\ud615\uc744 \ud6e8\uc52c \ub354 \ube60\ub974\uac8c \ucc98\ub9ac\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. <\/span><\/p>\n<p><span style=\"font-weight: 400\">5.0\uc758 \ud45c\uc900 \ubcf4\uc870 \uc778\ub371\uc2a4\ub294 \uc5d4\ud130\ud504\ub77c\uc774\uc988 \uc5d0\ub514\uc158\uc758 \ud50c\ub77c\uc988\ub9c8 \uc2a4\ud1a0\ub9ac\uc9c0 \uc5d4\uc9c4\uc744 \uc0ac\uc6a9\ud558\uba70, MOI\uc640 \uac19\uc740 \uc7a0\uae08 \uc5c6\ub294 \uc2a4\ud0b5 \ubaa9\ub85d\uc744 \uc0ac\uc6a9\ud558\uc9c0\ub9cc \uba54\ubaa8\ub9ac\uc5d0 \ub9de\uc9c0 \uc54a\ub294 \ub300\uc6a9\ub7c9 \uc778\ub371\uc2a4\ub97c \uc9c0\uc6d0\ud569\ub2c8\ub2e4.<\/span><\/p>\n<p><span style=\"font-weight: 400\">\uc138 \uac00\uc9c0 \uc720\ud615\uc758 \uc778\ub371\uc2a4\ub294 \ubaa8\ub450 \ub2e4\uc911 \ubc84\uc804 \ub3d9\uc2dc\uc131 \uc81c\uc5b4(MVCC)\ub97c \uad6c\ud604\ud558\uc5ec \uc77c\uad00\ub41c \uc778\ub371\uc2a4 \uc2a4\uce94 \uacb0\uacfc\uc640 \ub192\uc740 \ucc98\ub9ac\ub7c9\uc744 \uc81c\uacf5\ud569\ub2c8\ub2e4. \ud074\ub7ec\uc2a4\ud130 \uc124\uce58 \uc911\uc5d0 \uc778\ub371\uc2a4 \uc720\ud615\uc744 \uc120\ud0dd\ud569\ub2c8\ub2e4.<\/span><\/p>\n<p><span style=\"font-weight: 400\">\uc774 \uae00\uc758 \ubaa9\ud45c\ub294 \ucffc\ub9ac\ub97c \ud6a8\uc728\uc801\uc73c\ub85c \uc2e4\ud589\ud560 \uc218 \uc788\ub3c4\ub85d \uac01 \uc11c\ube44\uc2a4\uc5d0\uc11c \uc0dd\uc131\ud558\ub294 \ub2e4\uc591\ud55c \uc778\ub371\uc2a4\uc5d0 \ub300\ud55c \uac1c\uc694\ub97c \uc81c\uacf5\ud558\ub294 \uac83\uc785\ub2c8\ub2e4. \uc774 \uae00\uc758 \ubaa9\ud45c\ub294 \uc774 \ub450 \uac00\uc9c0 \uc720\ud615\uc758 \uc778\ub371\uc2a4 \uc11c\ube44\uc2a4\ub97c \uc124\uba85\ud558\uac70\ub098 \ube44\uad50 \ubc0f \ub300\uc870\ud558\ub294 \uac83\uc774 \uc544\ub2d9\ub2c8\ub2e4. Couchbase 5.0\uc5d0\uc11c \ucd9c\uc2dc\ub41c \uc804\uccb4 \ud14d\uc2a4\ud2b8 \uac80\uc0c9 \uc778\ub371\uc2a4(FTS)\ub294 \ub2e4\ub8e8\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4. <\/span><\/p>\n<p><span style=\"font-weight: 400\">\uc774\uc81c <strong>\uc5ec\ud589 \uc0d8\ud50c<\/strong> \ub370\uc774\ud130 \uc9d1\ud569\uc744 \ub9cc\ub4e4\uace0 \uc774\ub7ec\ud55c \uc778\ub371\uc2a4\ub97c \uc0ac\uc6a9\ud574 \ubcf4\uc138\uc694. <\/span><\/p>\n<p><span style=\"font-weight: 400\">\uc6f9 \ucf58\uc194\uc5d0\uc11c \ub2e4\uc74c \uc8fc\uc18c\ub85c \uc774\ub3d9\ud569\ub2c8\ub2e4. <strong>\uc124\uc815-&gt;\uc0d8\ud50c \ubc84\ud0b7<\/strong> \ub97c \ud074\ub9ad\ud558\uc5ec \uc5ec\ud589 \uc0d8\ud50c\uc744 \uc124\uce58\ud569\ub2c8\ub2e4.<\/span><\/p>\n<p><span style=\"font-weight: 400\">\ub2e4\uc74c\uc740 \uc0dd\uc131\ud560 \uc218 \uc788\ub294 \ub2e4\uc591\ud55c \uc778\ub371\uc2a4\uc785\ub2c8\ub2e4.<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><a href=\"https:\/\/www.couchbase.com\/blog\/ko\/primary-uses-for-couchbase-primary-index\/\"><strong>\uae30\ubcf8 \uc0c9\uc778<\/strong><\/a><\/li>\n<li style=\"font-weight: 400\"><strong>\uba85\uba85\ub41c \uae30\ubcf8 \uc778\ub371\uc2a4<\/strong><\/li>\n<li style=\"font-weight: 400\"><strong>\ubcf4\uc870 \uc0c9\uc778<\/strong><\/li>\n<li style=\"font-weight: 400\"><strong>\ubcf5\ud569 \ubcf4\uc870 \uc778\ub371\uc2a4<\/strong><\/li>\n<li style=\"font-weight: 400\"><strong>\uae30\ub2a5 \uc0c9\uc778<\/strong><\/li>\n<li style=\"font-weight: 400\"><strong>\ubc30\uc5f4 \uc0c9\uc778<\/strong><\/li>\n<li style=\"font-weight: 400\"><strong>ALL \ubc30\uc5f4<\/strong><\/li>\n<li style=\"font-weight: 400\"><strong>\ubaa8\ub4e0 \uace0\uc720 \ubc30\uc5f4<\/strong><\/li>\n<li style=\"font-weight: 400\"><strong>\ubd80\ubd84 \uc0c9\uc778<\/strong><\/li>\n<li style=\"font-weight: 400\"><strong>\uc801\uc751\ud615 \uc778\ub371\uc2a4<\/strong><\/li>\n<li style=\"font-weight: 400\"><strong>\uc911\ubcf5 \uc778\ub371\uc2a4<\/strong><\/li>\n<li style=\"font-weight: 400\"><strong>\ucee4\ubc84\ub9c1 \uc778\ub371\uc2a4<\/strong><\/li>\n<\/ul>\n<h2><b>\ubc30\uacbd<\/b><\/h2>\n<p><span style=\"font-weight: 400\">\uce74\uc6b0\uce58\ubca0\uc774\uc2a4\ub294 \ubd84\uc0b0\ud615 \ub370\uc774\ud130\ubca0\uc774\uc2a4\uc785\ub2c8\ub2e4. JSON\uc744 \uc0ac\uc6a9\ud558\ub294 \uc720\uc5f0\ud55c \ub370\uc774\ud130 \ubaa8\ub378\uc744 \uc9c0\uc6d0\ud569\ub2c8\ub2e4. \ubc84\ud0b7\uc758 \uac01 \ubb38\uc11c\uc5d0\ub294 \uc0ac\uc6a9\uc790\uac00 \uc0dd\uc131\ud55c \uace0\uc720 \ubb38\uc11c \ud0a4\uac00 \uc788\uc2b5\ub2c8\ub2e4. \uc774 \uace0\uc720\uc131\uc740 \ub370\uc774\ud130\ub97c \uc0bd\uc785\ud558\ub294 \ub3d9\uc548 \uc801\uc6a9\ub429\ub2c8\ub2e4.<\/span><\/p>\n<p><span style=\"font-weight: 400\">\ub2e4\uc74c\uc740 \ubb38\uc11c \uc608\uc2dc\uc785\ub2c8\ub2e4.<\/span><\/p>\n<pre class=\"font-size:17 line-height:20 lang:mysql decode:true\">SELECT meta().id, travel\r\n  FROM `travel-sample` travel\r\n  WHERE type = 'airline' limit 1;\r\n\r\n[\r\n  {\r\n    \"id\": \"airline_10\",\r\n      \"travel\": {\r\n        \"callsign\": \"MILE-AIR\",\r\n        \"country\": \"United States\",\r\n        \"iata\": \"Q5\",\r\n        \"icao\": \"MLA\",\r\n        \"id\": 10,\r\n        \"name\": \"40-Mile Air\",\r\n        \"type\": \"airline\"\r\n      }\r\n   }\r\n]\r\n<\/pre>\n<h2><b>\uc778\ub371\uc2a4 \uc720\ud615<\/b><\/h2>\n<h3><b>1. \uae30\ubcf8 \uc0c9\uc778<\/b><\/h3>\n<p><span style=\"font-weight: 400\">\uc5d0 \uae30\ubcf8 \uc778\ub371\uc2a4\ub97c \uc0dd\uc131\ud569\ub2c8\ub2e4. <strong>'travel-sample':<\/strong><\/span><\/p>\n<p><span style=\"font-weight: 400\">\uae30\ubcf8 \uc778\ub371\uc2a4\ub294 \ub2e8\uc21c\ud788 \uc804\uccb4 \ubc84\ud0b7\uc758 \ubb38\uc11c \ud0a4\uc5d0 \ub300\ud55c \uc778\ub371\uc2a4\uc785\ub2c8\ub2e4. Couchbase \ub370\uc774\ud130 \uacc4\uce35\uc740 \ubb38\uc11c \ud0a4\uc5d0 \uace0\uc720\uc131 \uc81c\uc57d \uc870\uac74\uc744 \uc801\uc6a9\ud569\ub2c8\ub2e4. \uae30\ubcf8 \uc778\ub371\uc2a4\ub294 Couchbase\uc758 \ub2e4\ub978 \ubaa8\ub4e0 \uc778\ub371\uc2a4\uc640 \ub9c8\ucc2c\uac00\uc9c0\ub85c \ube44\ub3d9\uae30\uc801\uc73c\ub85c \uc720\uc9c0\ub429\ub2c8\ub2e4. \ub370\uc774\ud130\uc758 \ucd5c\uc2e0\uc131\uc744 \uc124\uc815\ud558\ub294 \ubc29\ubc95\uc740 <\/span><a href=\"https:\/\/developer.couchbase.com\/documentation\/server\/current\/architecture\/querying-data-with-n1ql.html\"><span style=\"font-weight: 400\">\uc77c\uad00\uc131 \uc218\uc900<\/span><\/a><span style=\"font-weight: 400\"> \ub97c \uc785\ub825\ud558\uc138\uc694.<\/span><\/p>\n<p><span style=\"font-weight: 400\">\uc774 \uc778\ub371\uc2a4\uc758 \uba54\ud0c0\ub370\uc774\ud130\ub294 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4:<\/span><\/p>\n<pre class=\"font-size:17 line-height:20 lang:default decode:true\">SELECT * \r\n  FROM system:indexes \r\n  WHERE name = \u2018#primary\u2019;\r\n\r\n\"indexes\": {\r\n  \"datastore_id\": \"https:\/\/127.0.0.1:8091\",\r\n  \"id\": \"f6e3c75d6f396e7d\",\r\n  \"index_key\": [],\r\n  \"is_primary\": true,\r\n  \"keyspace_id\": \"travel-sample\",\r\n  \"name\": \"#primary\",\r\n  \"namespace_id\": \"default\",\r\n  \"state\": \"online\",\r\n  \"using\": \"gsi\"\r\n}\r\n<\/pre>\n<p><span style=\"font-weight: 400\">\uba54\ud0c0\ub370\uc774\ud130\ub294 \uc778\ub371\uc2a4\uc5d0 \ub300\ud55c \ucd94\uac00 \uc815\ubcf4\ub97c \uc81c\uacf5\ud569\ub2c8\ub2e4: \uc778\ub371\uc2a4\uac00 \uc788\ub294 \uc704\uce58(datastore_id), \uc778\ub371\uc2a4\uc758 \uc0c1\ud0dc(state), \uc778\ub371\uc2f1 \ubc29\ubc95(\uc0ac\uc6a9) \ub4f1\uc785\ub2c8\ub2e4.<\/span><\/p>\n<p><span style=\"font-weight: 400\">\uae30\ubcf8 \uc778\ub371\uc2a4\ub294 \ucffc\ub9ac\uc5d0 \ud544\ud130(\uc220\uc5b4)\uac00 \uc5c6\uac70\ub098 \ub2e4\ub978 \uc778\ub371\uc2a4 \ub610\ub294 \uc561\uc138\uc2a4 \uacbd\ub85c\ub97c \uc0ac\uc6a9\ud560 \uc218 \uc788\ub294 \uacbd\uc6b0 \uc804\uccb4 \ubc84\ud0b7 \uc2a4\uce94(\uae30\ubcf8 \uc2a4\uce94)\uc5d0 \uc0ac\uc6a9\ub429\ub2c8\ub2e4.  Couchbase\uc5d0\uc11c\ub294 \uc5ec\ub7ec \ud0a4 \uc2a4\ud398\uc774\uc2a4(\uc11c\ub85c \ub2e4\ub978 \uc720\ud615\uc758 \ubb38\uc11c, \uace0\uac1d, \uc8fc\ubb38, \uc7ac\uace0 \ub4f1)\ub97c \ud558\ub098\uc758 \ubc84\ud0b7\uc5d0 \uc800\uc7a5\ud569\ub2c8\ub2e4. \ub530\ub77c\uc11c \uae30\ubcf8 \uc2a4\uce94\uc744 \uc218\ud589\ud560 \ub54c \ucffc\ub9ac\ub294 \uc0c9\uc778\uc744 \uc0ac\uc6a9\ud558\uc5ec \ubb38\uc11c \ud0a4\ub97c \uac00\uc838\uc624\uace0 \ubc84\ud0b7\uc5d0 \uc788\ub294 \ubaa8\ub4e0 \ubb38\uc11c\ub97c \uac00\uc838\uc628 \ub2e4\uc74c \ud544\ud130\ub97c \uc801\uc6a9\ud569\ub2c8\ub2e4. \uc774\uac83\uc740 \ub9e4\uc6b0 \ube44\uc6a9\uc774 \ub9ce\uc774 \ub4ed\ub2c8\ub2e4.<\/span><\/p>\n<p><span style=\"font-weight: 400\">\ubb38\uc11c \ud0a4 \ub514\uc790\uc778\uc740 \uc5ec\ub7ec \ubd80\ubd84\uc73c\ub85c \uad6c\uc131\ub41c \uae30\ubcf8 \ud0a4 \ub514\uc790\uc778\uacfc \ub2e4\uc18c \uc720\uc0ac\ud569\ub2c8\ub2e4.<\/span><\/p>\n<p><span class=\"font-size:17 line-height:20 lang:mysql decode:true crayon-inline\">\uc131:\uc774\ub984:\uace0\uac1dID <\/span><\/p>\n<p><span class=\"font-size:17 line-height:20 lang:mysql decode:true crayon-inline\">Example: smith:john:X1A1849 <\/span><\/p>\n<p><span style=\"font-weight: 400\">Couchbase\uc5d0\uc11c\ub294 \ud0a4 \uc55e\uc5d0 \ubb38\uc11c \uc720\ud615\uc744 \uc811\ub450\uc0ac\ub85c \ubd99\uc774\ub294 \uac83\uc774 \uac00\uc7a5 \uc88b\uc2b5\ub2c8\ub2e4. \uc774 \ubb38\uc11c\ub294 \uace0\uac1d \ubb38\uc11c\uc774\ubbc0\ub85c \uc811\ub450\uc0ac \uc55e\uc5d0 CX\ub97c \ubd99\uc774\uaca0\uc2b5\ub2c8\ub2e4. \uc774\uc81c \ud0a4\ub294 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4:<\/span><\/p>\n<pre class=\"font-size:17 line-height:20 lang:mysql decode:true\">Example: CX:smith:john:X1A1849\r\n<\/pre>\n<p><span style=\"font-weight: 400\">\ub530\ub77c\uc11c \uac19\uc740 \ubc84\ud0b7\uc5d0 \ub2e4\ub978 \uc720\ud615\uc758 \ubb38\uc11c\uac00 \uc788\uc744 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<pre class=\"font-size:17 line-height:20 lang:mysql decode:true\">ORDERS type: \u00a0OD:US:CA:294829\r\n<\/pre>\n<pre class=\"font-size:17 line-height:20 lang:mysql decode:true\">ITEMS  type: IT:KD93823\r\n<\/pre>\n<p><span style=\"font-weight: 400\">\uc774\ub294 \ubaa8\ubc94 \uc0ac\ub840\uc77c \ubfd0\uc785\ub2c8\ub2e4. \ubc84\ud0b7 \ub0b4\uc5d0\uc11c \uace0\uc720\ud574\uc57c \ud55c\ub2e4\ub294 \uc810\uc744 \uc81c\uc678\ud558\uba74 Couchbase\uc5d0\uc11c \ubb38\uc11c \ud0a4\uc758 \ud615\uc2dd\uc774\ub098 \uad6c\uc870\uc5d0\ub294 \uc81c\ud55c\uc774 \uc5c6\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<p><span style=\"font-weight: 400\">\uc774\uc81c \ub2e4\uc591\ud55c \ud0a4\uac00 \uc788\ub294 \ubb38\uc11c\uac00 \uc788\uace0 \uae30\ubcf8 \uc0c9\uc778\uc774 \uc788\ub294 \uacbd\uc6b0 \ub2e4\uc74c \ucffc\ub9ac\ub97c \ud6a8\uc728\uc801\uc73c\ub85c \uc0ac\uc6a9\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<p><span style=\"font-weight: 400\">\uc608 1: \ud2b9\uc815 \ubb38\uc11c \ud0a4\ub97c \ucc3e\uace0 \uc788\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<pre class=\"font-size:17 line-height:20 lang:mysql decode:true\">SELECT * \r\n  FROM sales \r\n  WHERE META().id = \u201cCX:smith:john:X1A1849\u201d;\r\n\r\n{\r\n  \"#operator\": \"IndexScan2\",\r\n  \"index\": \"#primary\",\r\n  \"index_id\": \"4c92ab0bcca9690a\",\r\n  \"keyspace\": \"sales\",\r\n  \"namespace\": \"default\",\r\n  \"spans\": [\r\n    {\r\n      \"exact\": true,\r\n      \"range\": [\r\n        {\r\n          \"high\": \"\\\"CX:smith:john:X1A1849\\\"\",\r\n          \"inclusion\": 3,\r\n          \"low\": \"\\\"CX:smith:john:X1A1849\\\"\"\r\n        }\r\n      ]\r\n    }\r\n  ],\r\n}<\/pre>\n<p><span style=\"font-weight: 400\">\uc804\uccb4 \ubb38\uc11c \ud0a4\ub97c \uc54c\uace0 \uc788\ub294 \uacbd\uc6b0 \ub2e4\uc74c \ubb38\uc744 \uc0ac\uc6a9\ud558\uc5ec \uc778\ub371\uc2a4 \uc561\uc138\uc2a4\ub97c \uc644\uc804\ud788 \ud53c\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<p><span class=\"theme:dark-terminal lang:default decode:true crayon-inline\">SELECT * FROM sales USE KEYS [\u201cCX:smith:john:X1A1849\u201d] <\/span><\/p>\n<p><span style=\"font-weight: 400\">\uba85\uc138\uc11c\uc5d0 \ub450 \uac1c \uc774\uc0c1\uc758 \ubb38\uc11c\ub97c \ub123\uc744 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<pre class=\"font-size:17 line-height:20 lang:mysql decode:true\">SELECT * FROM sales USE KEYS [\u201cCX:smith:john:X1A1849\u201d, \u201cCX:smithjr:john:X2A1492\u201d]\r\n<\/pre>\n<p><b>\uc608 2:<\/b><span style=\"font-weight: 400\"> \ud328\ud134\uc744 \ucc3e\uc2b5\ub2c8\ub2e4. \ubaa8\ub4e0 \uace0\uac1d \ubb38\uc11c\ub97c \uac00\uc838\uc635\ub2c8\ub2e4.<\/span><\/p>\n<pre class=\"font-size:17 line-height:20 lang:mysql decode:true\">SELECT * \r\n  FROM sales \r\n  WHERE META().id \r\n  LIKE \u201cCX:%\u201d;\r\n\r\n{\r\n  \"#operator\": \"IndexScan2\",\r\n  \"index\": \"#primary\",\r\n  \"index_id\": \"4c92ab0bcca9690a\",\r\n  \"keyspace\": \"sales\",\r\n  \"namespace\": \"default\",\r\n  \"spans\": [\r\n    {\r\n      \"exact\": true,\r\n      \"range\": [\r\n        {\r\n          \"high\": \"\\\"CX;\\\"\",\r\n           \"inclusion\": 1,\r\n           \"low\": \"\\\"CX:\\\"\"\r\n        }\"\r\n      ]\r\n    }\r\n  ],\r\n}<\/pre>\n<p><b>\uc608 3:<\/b><span style=\"font-weight: 400\"> \ubaa8\ub4e0 \uace0\uac1d\uc744 \ub2e4\uc74c\uacfc \uac19\uc774 \ud655\ubcf4\ud558\uc138\uc694. <strong>\"smith\"<\/strong> \ub97c \uc131\uc73c\ub85c \uc0ac\uc6a9\ud569\ub2c8\ub2e4.<\/span><\/p>\n<p><span style=\"font-weight: 400\">\ub2e4\uc74c \ucffc\ub9ac\ub294 \uae30\ubcf8 \uc778\ub371\uc2a4\ub97c \ud6a8\uc728\uc801\uc73c\ub85c \uc0ac\uc6a9\ud558\uc5ec \ud2b9\uc815 \ubc94\uc704\uc758 \uace0\uac1d\ub9cc \uac00\uc838\uc635\ub2c8\ub2e4.<\/span> <b>\ucc38\uace0:<\/b><span style=\"font-weight: 400\"> \uc774 \uc2a4\uce94\uc740 \ub300\uc18c\ubb38\uc790\ub97c \uad6c\ubd84\ud569\ub2c8\ub2e4. \ub300\uc18c\ubb38\uc790\ub97c \uad6c\ubd84\ud558\uc9c0 \uc54a\ub294 \uc2a4\uce94\uc744 \uc218\ud589\ud558\ub824\uba74 \ubb38\uc11c \ud0a4\uc758 UPPER() \ub610\ub294 LOWER()\ub97c \uc0ac\uc6a9\ud558\uc5ec \ubcf4\uc870 \uc778\ub371\uc2a4\ub97c \ub9cc\ub4e4 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<pre class=\"font-size:17 line-height:20 lang:mysql decode:true\">SELECT * \r\n  FROM sales \r\n  WHERE META().id \r\n  LIKE \"CX:smith%\";\r\n\r\n{\r\n  \"#operator\": \"IndexScan2\",\r\n  \"index\": \"#primary\",\r\n  \"index_id\": \"4c92ab0bcca9690a\",\r\n  \"keyspace\": \"sales\",\r\n  \"namespace\": \"default\",\r\n  \"spans\": [\r\n    {\r\n      \"exact\": true,\r\n      \"range\": [\r\n        {\r\n          \"high\": \"\\\"CX:smiti\\\"\",\r\n          \"inclusion\": 1,\r\n          \"low\": \"\\\"CX:smith\\\"\"\r\n        }\r\n      ]\r\n    }\r\n  ],\r\n}<\/pre>\n<p><b>\uc608 4:<\/b><span style=\"font-weight: 400\"> \uc77c\ubd80 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc5d0\uc11c\ub294 \uc774\uba54\uc77c \uc8fc\uc18c\uac00 \uace0\uc720 \uac12\uc774\uae30 \ub54c\ubb38\uc5d0 \ubb38\uc11c\uc758 \uc77c\ubd80\ub85c \uc0ac\uc6a9\ud558\ub294 \uac83\uc774 \uc77c\ubc18\uc801\uc785\ub2c8\ub2e4. \uc774 \uacbd\uc6b0 \"@gmail.com\"\uc744 \uc0ac\uc6a9\ud558\ub294 \ubaa8\ub4e0 \uace0\uac1d\uc744 \ucc3e\uc544\uc57c \ud569\ub2c8\ub2e4. \uc774\uac83\uc774 \uc77c\ubc18\uc801\uc778 \uc694\uad6c \uc0ac\ud56d\uc774\ub77c\uba74 \uc774\uba54\uc77c \uc8fc\uc18c\uc758 \uc5ed\ubc29\ud5a5\uc744 \ud0a4\ub85c \uc800\uc7a5\ud558\uace0 \uc120\ud589 \ubb38\uc790\uc5f4 \ud328\ud134\uc744 \uc2a4\uce94\ud558\uae30\ub9cc \ud558\uba74 \ub429\ub2c8\ub2e4.<\/span><\/p>\n<p><span class=\"font-size:17 line-height:20 lang:default decode:true crayon-inline\">Email:johnsmith@gmail.com; &amp;nbsp;&amp;nbsp;key: reverse(&#8220;johnsmith@gmail.com&#8221;) =&gt; moc.liamg@htimsnhoj\u00a0<\/span><\/p>\n<p><span class=\"font-size:17 line-height:20 lang:default decode:true crayon-inline\">Email: janesnow@yahoo.com &amp;nbsp;key: reverse(&#8220;janesnow@yahoo.com&#8221;) =&gt; moc.oohay@wonsenaj<\/span><\/p>\n<pre class=\"font-size:17 line-height:20 lang:mysql decode:true\">SELECT *\r\n  FROM sales\r\n  WHERE meta().id \r\n  LIKE (reverse(\"@yahoo.com\") || \"%\");\r\n\r\n{\r\n  \"#operator\": \"IndexScan2\",\r\n  \"index\": \"#primary\",\r\n  \"index_id\": \"4c92ab0bcca9690a\",\r\n  \"keyspace\": \"sales\",\r\n  \"namespace\": \"default\",\r\n  \"spans\": [\r\n    {\r\n      \"range\": [\r\n        {\r\n          \"high\": \"\\\"moc.oohayA\\\"\",\r\n          \"inclusion\": 1,\r\n          \"low\": \"\\\"moc.oohay@\\\"\"\r\n        }\r\n      ]\r\n    }\r\n  ],\r\n}<\/pre>\n<h3><b>2. \uba85\uba85\ub41c \uae30\ubcf8 \uc0c9\uc778<\/b><\/h3>\n<p><span style=\"font-weight: 400\">Couchbase 5.0\uc5d0\uc11c\ub294 \uac04\ub2e8\ud55c \ub9e4\uac1c\ubcc0\uc218\uc778 CREATE INDEX\ub97c \uc0ac\uc6a9\ud558\uc5ec \uc778\ub371\uc2a4\uc758 \ubcf5\uc81c\ubcf8\uc744 \uc5ec\ub7ec \uac1c \ub9cc\ub4e4 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \ub2e4\uc74c\uc740 \uc778\ub371\uc2a4\uc758 \ubcf5\uc0ac\ubcf8 3\uac1c\ub97c \uc0dd\uc131\ud558\uba70 \ud074\ub7ec\uc2a4\ud130\uc5d0 \ucd5c\uc18c 3\uac1c\uc758 \uc778\ub371\uc2a4 \ub178\ub4dc\uac00 \uc788\uc5b4\uc57c \ud569\ub2c8\ub2e4.<\/span><\/p>\n<pre class=\"font-size:17 line-height:20 lang:mysql decode:true\">CREATE PRIMARY INDEX ON 'travel-sample' WITH {\"num_replica\":2}; \r\nCREATE PRIMARY INDEX `def_primary` ON `travel-sample` ;<\/pre>\n<p><span style=\"font-weight: 400\">\uae30\ubcf8 \uc778\ub371\uc2a4\uc758 \uc774\ub984\uc744 \uc9c0\uc815\ud560 \uc218\ub3c4 \uc788\uc2b5\ub2c8\ub2e4. \uae30\ubcf8 \uc778\ub371\uc2a4\uc758 \ub098\uba38\uc9c0 \uae30\ub2a5\uc740 \uc778\ub371\uc2a4 \uc774\ub984\uc744 \uc81c\uc678\ud558\uace0\ub294 \ub3d9\uc77c\ud569\ub2c8\ub2e4. \uc774 \uae30\ub2a5\uc758 \uc88b\uc740 \uc810\uc740 5.0 \uc774\uc804 Couchbase \ubc84\uc804\uc5d0\uc11c \uc11c\ub85c \ub2e4\ub978 \uc774\ub984\uc744 \uc0ac\uc6a9\ud558\uc5ec \uc5ec\ub7ec \uac1c\uc758 \uae30\ubcf8 \uc778\ub371\uc2a4\ub97c \uac00\uc9c8 \uc218 \uc788\ub2e4\ub294 \uac83\uc785\ub2c8\ub2e4. \uc911\ubcf5 \uc778\ub371\uc2a4\ub294 \uace0\uac00\uc6a9\uc131\ubfd0\ub9cc \uc544\ub2c8\ub77c \uc778\ub371\uc2a4 \uc804\uccb4\uc5d0 \ucffc\ub9ac \ubd80\ud558\ub97c \ubd84\uc0b0\ud558\ub294 \ub370 \ub3c4\uc6c0\uc774 \ub429\ub2c8\ub2e4. \uc774\ub294 \uae30\ubcf8 \uc778\ub371\uc2a4\uc640 \ubcf4\uc870 \uc778\ub371\uc2a4 \ubaa8\ub450\uc5d0 \ud574\ub2f9\ub429\ub2c8\ub2e4.<\/span><\/p>\n<pre class=\"font-size:17 line-height:20 whitespace-before:1 whitespace-after:01 lang:mysql decode:true\">SELECT meta().id as documentkey, `travel-sample` airline\r\n  FROM `travel-sample`\r\n  WHERE type = 'airline' limit 1;\r\n\r\n{\r\n  \"airline\": {\r\n    \"callsign\": \"MILE-AIR\",\r\n    \"country\": \"United States\",\r\n    \"iata\": \"Q5\",\r\n    \"icao\": \"MLA\",\r\n    \"id\": 10,\r\n    \"name\": \"40-Mile Air\",\r\n    \"type\": \"airline\"\r\n  },\r\n  \"documentkey\": \"airline_10\"\r\n}\r\n<\/pre>\n<h3><b>3. \ubcf4\uc870 \uc0c9\uc778<\/b><\/h3>\n<p><span style=\"font-weight: 400\">\ubcf4\uc870 \uc778\ub371\uc2a4\ub294 \ubaa8\ub4e0 \ud0a4-\uac12 \ub610\ub294 \ubb38\uc11c-\ud0a4\uc5d0 \ub300\ud55c \uc778\ub371\uc2a4\uc785\ub2c8\ub2e4. \uc774 \uc778\ub371\uc2a4\ub294 \ubb38\uc11c \ub0b4\uc758 \ubaa8\ub4e0 \ud0a4\uac00 \ub420 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \ud0a4\ub294 \uc2a4\uce7c\ub77c, \uac1d\uccb4, \ubc30\uc5f4 \ub4f1 \uc5b4\ub5a4 \uac83\uc774\ub4e0 \ub420 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \ucffc\ub9ac\ub294 \uc778\ub371\uc2a4\ub97c \ud65c\uc6a9\ud558\uae30 \uc704\ud574 \ucffc\ub9ac \uc5d4\uc9c4\uacfc \ub3d9\uc77c\ud55c \uc720\ud615\uc758 \uac1d\uccb4\ub97c \uc0ac\uc6a9\ud574\uc57c \ud569\ub2c8\ub2e4.<\/span><\/p>\n<pre class=\"font-size:17 line-height:20 lang:mysql decode:true\">CREATE INDEX travel_name ON `travel-sample`(name);\r\n\r\nname is a simple scalar value.\r\n{\r\n  \"name\": \"Air France\"\r\n}\r\n\r\nCREATE INDEX travel_geo on `travel-sample`(geo);\r\n\r\ngeo is an object embedded within the document. Example:\r\n\r\n\"geo\": {\r\n  \"alt\": 12,\r\n  \"lat\": 50.962097,\r\n  \"lon\": 1.954764\r\n}\r\n\r\nCreating indexes on keys from nested objects is straightforward.\r\nCREATE INDEX travel_geo on `travel-sample`(geo.alt);\r\nCREATE INDEX travel_geo on `travel-sample`(geo.lat);<\/pre>\n<p><span style=\"font-weight: 400\">\uc2a4\ucf00\uc904 \ud544\ub4dc\ub294 \ud56d\uacf5\ud3b8 \uc138\ubd80 \uc815\ubcf4\uac00 \ud3ec\ud568\ub41c \uac1d\uccb4 \ubc30\uc5f4\uc785\ub2c8\ub2e4. \uc804\uccb4 \ubc30\uc5f4\uc744 \uc778\ub371\uc2f1\ud569\ub2c8\ub2e4. \uc804\uccb4 \ubc30\uc5f4\uc744 \ucc3e\ub294 \uacbd\uc6b0\uac00 \uc544\ub2c8\ub77c\uba74 \uc720\uc6a9\ud558\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<pre class=\"font-size:17 line-height:20 lang:mysql decode:true\">CREATE INDEX travel_schedule ON `travel-sample`(schedule);\r\n\r\nExample:\r\n\r\n\"schedule\": [\r\n  {\r\n     \"day\": 0,\r\n     \"flight\": \"AF198\",\r\n     \"utc\": \"10:13:00\"\r\n  },\r\n  {\r\n     \"day\": 0,\r\n     \"flight\": \"AF547\",\r\n     \"utc\": \"19:14:00\"\r\n  },\r\n  {\r\n     \"day\": 0,\r\n     \"flight\": \"AF943\",\r\n     \"utc\": \"01:31:00\"\r\n  },\r\n  {\r\n    \"day\": 1,\r\n    \"flight\": \"AF356\",\r\n    \"utc\": \"12:40:00\"\r\n  },\r\n  {\r\n    \"day\": 1,\r\n    \"flight\": \"AF480\",\r\n    \"utc\": \"08:58:00\"\r\n  },\r\n  {\r\n     \"day\": 1,\r\n     \"flight\": \"AF250\",\r\n     \"utc\": \"12:59:00\"\r\n  }\r\n]\r\n<\/pre>\n<h3><b>4. \ubcf5\ud569 \ubcf4\uc870 \uc778\ub371\uc2a4<\/b><\/h3>\n<p><span style=\"font-weight: 400\">\uc5ec\ub7ec \uac1c\uc758 \ud544\ud130(\uc220\uc5b4)\uac00 \uc788\ub294 \ucffc\ub9ac\ub97c \uc0ac\uc6a9\ud558\ub294 \uac83\uc774 \uc77c\ubc18\uc801\uc785\ub2c8\ub2e4. \ub530\ub77c\uc11c \uc778\ub371\uc2a4\uac00 \ud55c\uc815\ub41c \ubb38\uc11c \ud0a4\ub9cc \ubc18\ud658\ud560 \uc218 \uc788\ub3c4\ub85d \uc5ec\ub7ec \uac1c\uc758 \ud0a4\uac00 \uc788\ub294 \uc778\ub371\uc2a4\uac00 \ud544\uc694\ud569\ub2c8\ub2e4. \ub610\ud55c \ucffc\ub9ac\uac00 \uc778\ub371\uc2a4\uc758 \ud0a4\ub9cc \ucc38\uc870\ud558\ub294 \uacbd\uc6b0, \ucffc\ub9ac \uc5d4\uc9c4\uc740 \ub370\uc774\ud130 \ub178\ub4dc\ub85c \uc774\ub3d9\ud558\uc9c0 \uc54a\uace0 \uc778\ub371\uc2a4 \uc2a4\uce94 \uacb0\uacfc\uc5d0\uc11c \ucffc\ub9ac\uc5d0 \uac04\ub2e8\ud788 \uc751\ub2f5\ud569\ub2c8\ub2e4. \uc774\uac83\uc740 \uc77c\ubc18\uc801\uc73c\ub85c \uc545\uc6a9\ub418\ub294 \uc131\ub2a5 \ucd5c\uc801\ud654 \ubc29\ubc95\uc785\ub2c8\ub2e4.<\/span><\/p>\n<pre class=\"font-size:17 line-height:20 lang:default decode:true\">CREATE INDEX idx_stctln ON&amp;nbsp; `travel-sample` (state, city, name.lastname)<\/pre>\n<p><span style=\"font-weight: 400\">\uac01 \ud0a4\ub294 \ub2e8\uc21c\ud55c \uc2a4\uce7c\ub77c \ud544\ub4dc, \uac1d\uccb4 \ub610\ub294 \ubc30\uc5f4\uc77c \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc778\ub371\uc2a4 \ud544\ud130\ub9c1\uc744 \ud65c\uc6a9\ud558\ub824\uba74 \ud544\ud130\uac00 \ucffc\ub9ac \ud544\ud130\uc5d0\uc11c \ud574\ub2f9 \uac1d\uccb4 \uc720\ud615\uc744 \uc0ac\uc6a9\ud574\uc57c \ud569\ub2c8\ub2e4. \uc778\ub371\uc2a4\uc5d0\uc11c \ud544\ud130\ub9c1\ud574\uc57c \ud558\ub294 \uacbd\uc6b0 \ubcf4\uc870 \uc778\ub371\uc2a4\uc758 \ud0a4\uc5d0 \ubb38\uc11c \ud0a4(meta().id)\ub97c \uba85\uc2dc\uc801\uc73c\ub85c \ud3ec\ud568\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<p><span style=\"font-weight: 400\">\uc778\ub371\uc2a4\ub97c \uc545\uc6a9\ud558\ub294 \ucffc\ub9ac\uc640 \uc545\uc6a9\ud560 \uc218 \uc5c6\ub294 \ucffc\ub9ac\ub97c \uc0b4\ud3b4\ubcf4\uaca0\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<pre class=\"font-size:17 line-height:20 wrap:true scroll:true whitespace-before:2 lang:mysql decode:true\">1.SELECT * FROM `travel-sample` WHERE state = 'CA';\r\nThe predicate matches the leading key of the index. So, this query uses the index to fully evaluate the predicate (state = \u2018CA\u2019). \r\n\r\n2.SELECT * FROM `travel-sample` WHERE state = 'CA' AND city = 'Windsor';\r\nThe predicates match the leading two keys. So this is good fit as well.\r\n\r\n3.SELECT * FROM `travel-sample` WHERE state = 'CA' AND city = 'Windsor' AND name.lastname = 'smith';\r\n\r\nThe three predicates in this query matches the three index keys perfectly. So, this is a good match.\r\n\r\n4.SELECT * FROM `travel-sample` WHERE city = 'Windsor' AND name.lastname = 'smith';\r\n\r\nIn this query, although predicates match two of the index keys, the leading key isn\u2019t matched. So, the index cannot and is not used for this query plans.\r\n\r\n5.SELECT * FROM `travel-sample` WHERE name.lastname = 'smith';\r\nSimilar to previous query, this query has the predicate on the third key of the index. So, this index cannot be used.\r\n\r\n6.SELECT * FROM `travel-sample` WHERE state = 'CA' AND name.lastname = 'smith';\r\n\r\nThis query has predicate on first and the third key. While this index is and can be chosen, we cannot push down the predicate after skipping an index key (second key in this case). So, only the first predicate (state = \"CA\") will be pushed down to index scan.\r\n\r\n\"#operator\": \"IndexScan2\",\r\n\"index\": \"idx_stctln\",\r\n\"index_id\": \"dadbb12da565ed28\",\r\n\"index_projection\": {\r\n  \"primary_key\": true\r\n},\r\n\"keyspace\": \"travel-sample\",\r\n\"namespace\": \"default\",\r\n\"spans\": [\r\n  {\r\n    \"exact\": true,\r\n    \"range\": [\r\n      {\r\n        \"high\": \"\\\"CA\\\"\",\r\n        \"inclusion\": 3,\r\n        \"low\": \"\\\"CA\\\"\"\r\n      }\r\n   ]\r\n}\r\n\r\n7.SELECT * FROM `travel-sample` WHERE state IS NOT MISSING AND city = 'Windsor' AND name.lastname = 'smith';\r\n \r\nThis is a modified version of query 4 above. To use this index, the query needs to have an additional predicate (state IS NOT MISSING) assuming that represents your application requirement.\r\n<\/pre>\n<h3><b>5. \uae30\ub2a5(\ud45c\ud604\uc2dd) \uc0c9\uc778<\/b><\/h3>\n<p><span style=\"font-weight: 400\">\ub370\uc774\ud130\ubca0\uc774\uc2a4\uc5d0 \ub300\ubb38\uc790\uc640 \uc18c\ubb38\uc790\uac00 \ud63c\ud569\ub41c \uc774\ub984\uc774 \uc788\ub294 \uac83\uc774 \uc77c\ubc18\uc801\uc785\ub2c8\ub2e4. 'John'\uc744 \uac80\uc0c9\ud574\uc57c \ud558\ub294 \uacbd\uc6b0 'John', 'john' \ub4f1\uc758 \ubaa8\ub4e0 \uc870\ud569\uc744 \uac80\uc0c9\ud574\uc57c \ud569\ub2c8\ub2e4. \uac80\uc0c9 \ubc29\ubc95\uc740 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<p><span class=\"font-size:17 line-height:20 lang:mysql decode:true crayon-inline\">CREATE INDEX travel_cxname ON `travel-sample`(LOWER(name)); <\/span><\/p>\n<p><span style=\"font-weight: 400\">\uac80\uc0c9 \ubb38\uc790\uc5f4\uc744 \uc18c\ubb38\uc790\ub85c \uc785\ub825\ud558\uba74 \uc778\ub371\uc2a4\uc5d0\uc11c \uc774\ubbf8 \uc18c\ubb38\uc790\ub85c \uc785\ub825\ub41c \uac12\uc744 \ud6a8\uc728\uc801\uc73c\ub85c \uac80\uc0c9\ud569\ub2c8\ub2e4.<\/span><\/p>\n<pre class=\"font-size:17 line-height:20 lang:mysql decode:true\">EXPLAIN SELECT * FROM `travel-sample` WHERE LOWER(name) = \"john\";\r\n\r\n{\r\n  \"#operator\": \"IndexScan\",\r\n  \"index\": \"travel_cxname\",\r\n  \"index_id\": \"2f39d3b7aac6bbfe\",\r\n  \"keyspace\": \"travel-sample\",\r\n  \"namespace\": \"default\",\r\n  \"spans\": [\r\n    {\r\n      \"Range\": {\r\n        \"High\": [\r\n          \"\\\"john\\\"\"\r\n        ],\r\n        \"Inclusion\": 3,\r\n        \"Low\": [\r\n          \"\\\"john\\\"\"\r\n        ]\r\n      }\r\n    }\r\n  ]\r\n}<\/pre>\n<p><span style=\"font-weight: 400\">\uc774 \ud568\uc218 \uc778\ub371\uc2a4\uc5d0\uc11c\ub294 \ubcf5\uc7a1\ud55c \ud45c\ud604\uc2dd\uc744 \uc0ac\uc6a9\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<p><span class=\"font-size:17 line-height:20 whitespace-before:1 lang:mysql decode:true crayon-inline\">CREATE INDEX travel_cx1 ON `travel-sample`(LOWER(name),\u00a0length*width, round(salary)); <\/span><\/p>\n<p><span style=\"font-weight: 400\">\ub610\ud55c \ub2e4\uc74c \uc139\uc158\uc5d0\uc11c \ubc30\uc5f4\uc744 \ubc18\ud658\ud558\ub294 \ud45c\ud604\uc2dd\uc5d0\uc11c \ubc30\uc5f4 \uc778\ub371\uc2a4\ub97c \ub9cc\ub4e4 \uc218 \uc788\ub2e4\ub294 \uac83\uc744 \uc54c\uac8c \ub420 \uac83\uc785\ub2c8\ub2e4.<\/span><\/p>\n<h3><b>6. \ubc30\uc5f4 \uc0c9\uc778<\/b><\/h3>\n<p><span style=\"font-weight: 400\">JSON\uc740 \uacc4\uce35\uc801\uc785\ub2c8\ub2e4. \ucd5c\uc0c1\uc704 \uc218\uc900\uc5d0\ub294 \uc2a4\uce7c\ub77c \ud544\ub4dc, \uac1d\uccb4 \ub610\ub294 \ubc30\uc5f4\uc774 \uc788\uc744 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uac01 \uac1d\uccb4\ub294 \ub2e4\ub978 \uac1d\uccb4\uc640 \ubc30\uc5f4\uc744 \uc911\ucca9\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uac01 \ubc30\uc5f4\uc740 \ub2e4\ub978 \uac1d\uccb4\uc640 \ubc30\uc5f4\uc744 \uac00\uc9c8 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \ub4f1\ub4f1. \uc911\ucca9\uc740 \uacc4\uc18d\ub429\ub2c8\ub2e4.<\/span><\/p>\n<p><span style=\"font-weight: 400\">\uc774\ub807\uac8c \ud48d\ubd80\ud55c \uad6c\uc870\uac00 \uc788\ub294 \uacbd\uc6b0 \ud558\uc704 \uac1c\uccb4 \ub0b4\uc5d0\uc11c \ud2b9\uc815 \ubc30\uc5f4\uc774\ub098 \ud544\ub4dc\ub97c \uc0c9\uc778\ud558\ub294 \ubc29\ubc95\uc740 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<p><span style=\"font-weight: 400\">\ubc30\uc5f4, \uc77c\uc815\uc744 \uace0\ub824\ud558\uc138\uc694:<\/span><\/p>\n<pre class=\"font-size:17 line-height:20 lang:mysql decode:true\">schedule: [\r\n  {\r\n    \"day\" : 0,\r\n    \"special_flights\" :\r\n      [\r\n        {\r\n          \"flight\" : \"AI111\", \"utc\" : \u201d1:11:11\"\r\n        },\r\n        {\r\n          \"flight\" : \"AI222\", \"utc\" : \u201d2:22:22\"\r\n        }  \r\n      ]\r\n    },\r\n  {\r\n    \"day\": 1,\r\n    \"flight\": \"AF552\",\r\n    \"utc\": \"14:41:00\u201d\r\n  }\r\n]\r\n\r\nCREATE INDEX travel_sched ON `travel-sample`\r\n(ALL DISTINCT ARRAY v.day FOR v IN schedule END)\r\n<\/pre>\n<p><span style=\"font-weight: 400\">\uc774 \uc778\ub371\uc2a4 \ud0a4\ub294 \uc778\ub371\uc2f1\ud560 \uc694\uc18c\ub9cc \uba85\ud655\ud558\uac8c \ucc38\uc870\ud558\uae30 \uc704\ud55c \ubc30\uc5f4\uc758 \ud45c\ud604\uc2dd\uc785\ub2c8\ub2e4. schedule\uc740 \uc6b0\ub9ac\uac00 \uc5ed\ucc38\uc870\ud558\ub294 \ubc30\uc5f4\uc785\ub2c8\ub2e4. v\ub294 \ubc30\uc5f4 \ub0b4\uc758 \uac01 \uc694\uc18c\/\uac1d\uccb4\ub97c \ucc38\uc870\ud558\ub3c4\ub85d \uc554\uc2dc\uc801\uc73c\ub85c \uc120\uc5b8\ud55c \ubcc0\uc218\uc785\ub2c8\ub2e4. schedule v.day\ub294 \ubc30\uc5f4 schedule\uc758 \uac01 \uac1d\uccb4 \ub0b4\uc758 \uc694\uc18c\ub97c \ucc38\uc870\ud569\ub2c8\ub2e4.<\/span><\/p>\n<p><span style=\"font-weight: 400\">\uc544\ub798 \ucffc\ub9ac\ub294 \ubc30\uc5f4 \uc778\ub371\uc2a4\ub97c \ud65c\uc6a9\ud569\ub2c8\ub2e4.<\/span><\/p>\n<pre class=\"font-size:17 line-height:20 lang:mysql decode:true\">EXPLAIN SELECT * FROM `travel-sample` WHERE ANY v IN SCHEDULE SATISFIES v.day = 2 END;\r\n\r\n{\r\n  \"#operator\": \"DistinctScan\",\r\n  \"scan\": {\r\n    \"#operator\": \"IndexScan\",\r\n    \"index\": \"travel_sched\",\r\n    \"index_id\": \"db7018bff5f10f17\",\r\n    \"keyspace\": \"travel-sample\",\r\n    \"namespace\": \"default\",\r\n    \"spans\": [\r\n      {\r\n        \"Range\": {\r\n           \"High\": [\r\n             \"2\"\r\n           ],\r\n           \"Inclusion\": 3,\r\n           \"Low\": [\r\n             \"2\"\r\n           ]\r\n         }\r\n       }\r\n    ],\r\n  \"using\": \"gsi\"\r\n}\r\n<\/pre>\n<p><span style=\"font-weight: 400\">\ud0a4\ub294 \uc77c\ubc18\ud654\ub41c \ud45c\ud604\uc2dd\uc774\ubbc0\ub85c \uc778\ub371\uc2f1\ud558\uae30 \uc804\uc5d0 \ub370\uc774\ud130\uc5d0 \ucd94\uac00 \ub85c\uc9c1\uacfc \ucc98\ub9ac\ub97c \uc720\uc5f0\ud558\uac8c \uc801\uc6a9\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc608\ub97c \ub4e4\uc5b4, \uac01 \ubc30\uc5f4\uc758 \uc694\uc18c\uc5d0 \ud568\uc218\ud615 \uc778\ub371\uc2f1\uc744 \uc0dd\uc131\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \ubc30\uc5f4 \ub0b4\uc758 \uac1d\uccb4 \ub610\ub294 \uc694\uc18c\uc758 \uac1c\ubcc4 \ud544\ub4dc\ub97c \ucc38\uc870\ud558\uae30 \ub54c\ubb38\uc5d0 <a href=\"https:\/\/docs.couchbase.com\/server\/current\/n1ql\/n1ql-language-reference\/createindex.html\">\uc778\ub371\uc2a4 \uc0dd\uc131<\/a>\ud06c\uae30 \ubc0f \uac80\uc0c9\uc774 \ud6a8\uc728\uc801\uc785\ub2c8\ub2e4. \uc704\uc758 \uc778\ub371\uc2a4\ub294 \ubc30\uc5f4 \ub0b4\uc758 \uace0\uc720 \uac12\ub9cc \uc800\uc7a5\ud569\ub2c8\ub2e4. \ubc30\uc5f4\uc758 \ubaa8\ub4e0 \uc694\uc18c\ub97c \uc778\ub371\uc2a4\uc5d0 \uc800\uc7a5\ud558\ub824\uba74 \ud45c\ud604\uc2dd\uc5d0 DISTINCT \uc218\uc815\uc790\ub97c \uc0ac\uc6a9\ud569\ub2c8\ub2e4.<\/span><\/p>\n<p><span class=\"font-size:17 line-height:20 lang:mysql decode:true crayon-inline\">CREATE INDEX travel_sched ON `travel-sample`\u00a0(ALL DISTINCT ARRAY v.day FOR v IN schedule END) <\/span><\/p>\n<p><span style=\"font-weight: 400\">\ubc30\uc5f4 \uc778\ub371\uc2a4\ub294 \uc704\uc640 \uac19\uc774 \uc815\uc801 \uac12 \ub610\ub294 \ubc30\uc5f4\uc744 \ubc18\ud658\ud558\ub294 \ud45c\ud604\uc2dd\uc73c\ub85c \ub9cc\ub4e4 \uc218 \uc788\uc2b5\ub2c8\ub2e4. <\/span><a href=\"https:\/\/developer.couchbase.com\/documentation\/server\/current\/n1ql\/n1ql-language-reference\/tokenfun.html\"><span style=\"font-weight: 400\">TOKENS()<\/span><\/a><span style=\"font-weight: 400\"> \ub294 \uac1d\uccb4\uc5d0\uc11c \ud1a0\ud070 \ubc30\uc5f4\uc744 \ubc18\ud658\ud558\ub294 \ud45c\ud604\uc2dd \uc911 \ud558\ub098\uc785\ub2c8\ub2e4. \uc774 \ubc30\uc5f4\uc5d0 \uc778\ub371\uc2a4\ub97c \uc0dd\uc131\ud558\uace0 \uc778\ub371\uc2a4\ub97c \uc0ac\uc6a9\ud558\uc5ec \uac80\uc0c9\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Couchbase 5.0\uc5d0\uc11c\ub294 \ubc30\uc5f4 \uc778\ub371\uc2a4\ub97c \ub354 \uac04\ub2e8\ud558\uac8c \uc0dd\uc131\ud558\uace0 \uc77c\uce58\uc2dc\ud0ac \uc218 \uc788\uc2b5\ub2c8\ub2e4. \ud0a4\uc5d0 ALL(\ub610\ub294 ALL DISTINCT) \uc811\ub450\uc0ac\ub97c \uc81c\uacf5\ud558\uba74 \ubc30\uc5f4 \ud0a4\uac00 \ub429\ub2c8\ub2e4.<\/span><\/p>\n<pre class=\"font-size:17 line-height:20 wrap:true lang:mysql decode:true\">CREATE INDEX idx_cx6 \r\n  ON `travel-sample`(ALL TOKENS(public_likes)) \r\n  WHERE type = \u2018hotel\u2019;\r\n\r\nSELECT t.name, t.country, t.public_likes\r\n  FROM `travel-sample` t\r\n  WHERE t.type = 'hotel\u2019\r\n    AND ANY p IN TOKENS(public_likes) \r\n    SATISFIES p = 'Vallie' END;\r\n<\/pre>\n<p><span style=\"font-weight: 400\">\ubc30\uc5f4 \uc778\ub371\uc2a4\ub294 \ubc30\uc5f4\uc758 \ubc30\uc5f4 \ub0b4 \uc694\uc18c\uc5d0\ub3c4 \ub9cc\ub4e4 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \ubc30\uc5f4 \ud45c\ud604\uc2dd\uc758 \uc911\ucca9 \uc218\uc900\uc5d0\ub294 \uc81c\ud55c\uc774 \uc5c6\uc2b5\ub2c8\ub2e4. \ucffc\ub9ac \ud45c\ud604\uc2dd\uc740 \uc778\ub371\uc2a4 \ud45c\ud604\uc2dd\uacfc \uc77c\uce58\ud574\uc57c \ud569\ub2c8\ub2e4.<\/span><\/p>\n<h3><b>7. \ubd80\ubd84 \uc0c9\uc778<\/b><\/h3>\n<p><span style=\"font-weight: 400\">\uc9c0\uae08\uae4c\uc9c0 \ub9cc\ub4e0 \uc778\ub371\uc2a4\ub294 \uc804\uccb4 \ubc84\ud0b7\uc5d0 \ub300\ud55c \uc778\ub371\uc2a4\ub97c \uc0dd\uc131\ud569\ub2c8\ub2e4. \uce74\uc6b0\uce58\ubca0\uc774\uc2a4 \ub370\uc774\ud130 \ubaa8\ub378\uc740 JSON\uc774\uace0 JSON \uc2a4\ud0a4\ub9c8\ub294 \uc720\uc5f0\ud558\uae30 \ub54c\ubb38\uc5d0 \uc778\ub371\uc2a4\uc5d0 \uc778\ub371\uc2a4 \ud0a4\uac00 \uc5c6\ub294 \ubb38\uc11c\uc5d0 \ub300\ud55c \ud56d\ubaa9\uc774 \ud3ec\ud568\ub418\uc9c0 \uc54a\uc744 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc774\ub294 \uc608\uc0c1\ub418\ub294 \uc77c\uc785\ub2c8\ub2e4. \uac01 \uc720\ud615\uc758 \ud589\uc774 \ubcc4\uac1c\uc758 \ud14c\uc774\ube14\uc5d0 \uc788\ub294 \uad00\uacc4\ud615 \uc2dc\uc2a4\ud15c\uacfc \ub2ec\ub9ac, \uce74\uc6b0\uce58\ubca0\uc774\uc2a4 \ubc84\ud0b7\uc5d0\ub294 \ub2e4\uc591\ud55c \uc720\ud615\uc758 \ubb38\uc11c\uac00 \uc788\uc744 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc77c\ubc18\uc801\uc73c\ub85c \uace0\uac1d\uc740 \uace0\uc720\ud55c \uc720\ud615\uc744 \uad6c\ubd84\ud558\uae30 \uc704\ud574 \uc720\ud615 \ud544\ub4dc\ub97c \ud3ec\ud568\ud569\ub2c8\ub2e4.<\/span><\/p>\n<pre class=\"font-size:17 line-height:20 lang:js decode:true\">{\r\n  \"airline\": {\r\n    \"callsign\": \"MILE-AIR\",\r\n    \"country\": \"United States\",\r\n    \"iata\": \"Q5\",\r\n    \"icao\": \"MLA\",\r\n    \"id\": 10,\r\n    \"name\": \"40-Mile Air\",\r\n    \"type\": \"airline\"\r\n      },\r\n  \"documentkey\": \"airline_10\"\r\n}\r\n<\/pre>\n<p><span style=\"font-weight: 400\">\ud56d\uacf5\uc0ac \ubb38\uc11c\uc758 \uc0c9\uc778\uc744 \ub9cc\ub4e4\ub824\uba74 \uc0c9\uc778\uc758 WHERE \uc808\uc5d0 \uc720\ud615 \ud544\ub4dc\ub97c \ucd94\uac00\ud558\uae30\ub9cc \ud558\uba74 \ub429\ub2c8\ub2e4.<\/span><\/p>\n<p><span class=\"font-size:17 line-height:20 lang:mysql decode:true crayon-inline\">CREATE INDEX travel_info ON `travel-sample`(name, id, icoo, iata) WHERE type = &#8216;airline&#8217;;<\/span><\/p>\n<p><span style=\"font-weight: 400\">\uc774\ub807\uac8c \ud558\uba74 (\uc720\ud615 = '\ud56d\uacf5\uc0ac')\uac00 \uc788\ub294 \ubb38\uc11c\uc5d0\ub9cc \uc778\ub371\uc2a4\uac00 \uc0dd\uc131\ub429\ub2c8\ub2e4. \ucffc\ub9ac\uc5d0\uc11c \ub2e4\ub978 \ud544\ud130\uc640 \ud568\uaed8 \ud544\ud130(\uc720\ud615 = '\ud56d\uacf5\uc0ac')\ub97c \ud3ec\ud568\ud574\uc57c \uc774 \uc778\ub371\uc2a4\uac00 \uc790\uaca9\uc744 \uac16\ucd94\uac8c \ub429\ub2c8\ub2e4.<\/span><\/p>\n<p><span style=\"font-weight: 400\">\uc778\ub371\uc2a4\uc758 WHERE \uc808\uc5d0\uc11c \ubcf5\uc7a1\ud55c \uc220\uc5b4\ub97c \uc0ac\uc6a9\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \ubd80\ubd84 \uc778\ub371\uc2a4\ub97c \ud65c\uc6a9\ud558\ub294 \ub2e4\uc591\ud55c \uc0ac\uc6a9 \uc0ac\ub840\uac00 \uc788\uc2b5\ub2c8\ub2e4:<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">\ubaa8\ub4dc \ud568\uc218\ub97c \uc0ac\uc6a9\ud558\uc5ec \ud070 \uc778\ub371\uc2a4\ub97c \uc5ec\ub7ec \uc778\ub371\uc2a4\ub85c \ubd84\ud560\ud569\ub2c8\ub2e4.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">\ud070 \uc778\ub371\uc2a4\ub97c \uc5ec\ub7ec \uc778\ub371\uc2a4\ub85c \ubd84\ud560\ud558\uace0 \uac01 \uc778\ub371\uc2a4\ub97c \ubcc4\uac1c\uc758 \uc778\ub371\uc11c \ub178\ub4dc\uc5d0 \ubc30\uce58\ud569\ub2c8\ub2e4.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">\uac12 \ubaa9\ub85d\uc744 \uae30\ubc18\uc73c\ub85c \uc778\ub371\uc2a4\ub97c \ubd84\ud560\ud569\ub2c8\ub2e4. \uc608\ub97c \ub4e4\uc5b4 \uac01 \uc8fc\uc5d0 \ub300\ud55c \uc778\ub371\uc2a4\ub97c \uac00\uc9c8 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">WHERE \uc808\uc758 \ubc94\uc704 \ud544\ud130\ub97c \ud1b5\ud574 \uc778\ub371\uc2a4 \ubc94\uc704 \ubd84\ud560\uc744 \uc2dc\ubbac\ub808\uc774\uc158\ud569\ub2c8\ub2e4. \ud55c \uac00\uc9c0 \uae30\uc5b5\ud574\uc57c \ud560 \uac83\uc740 Couchbase N1QL \ucffc\ub9ac\ub294 \ucffc\ub9ac \ube14\ub85d\ub2f9 \ud558\ub098\uc758 \ubd84\ud560\ub41c \uc778\ub371\uc2a4\ub97c \uc0ac\uc6a9\ud55c\ub2e4\ub294 \uac83\uc785\ub2c8\ub2e4. \ucffc\ub9ac\uac00 \ub2e8\uc77c \ucffc\ub9ac\uc5d0\uc11c \uc5ec\ub7ec \ubd84\ud560\ub41c \uc778\ub371\uc2a4\ub97c \ud65c\uc6a9\ud558\ub3c4\ub85d \ud558\ub824\uba74 UNION ALL\uc744 \uc0ac\uc6a9\ud558\uc138\uc694.<\/span><\/li>\n<\/ol>\n<h3><b>8. \uc801\uc751\ud615 \uc778\ub371\uc2a4<\/b><\/h3>\n<p><span style=\"font-weight: 400\">\uc801\uc751\ud615 \uc778\ub371\uc2a4\ub294 \uc804\uccb4 \ubb38\uc11c \ub610\ub294 \ubb38\uc11c \ub0b4 \ud544\ub4dc \uc9d1\ud569\uc5d0 \ub2e8\uc77c \uc778\ub371\uc2a4\ub97c \uc0dd\uc131\ud569\ub2c8\ub2e4. \uc774\uac83\uc740 {\"key\": value} \uc30d\uc744 \ub2e8\uc77c \uc778\ub371\uc2a4 \ud0a4\ub85c \uc0ac\uc6a9\ud558\ub294 \ud3fc \ub610\ub294 \ubc30\uc5f4 \uc778\ub371\uc2a4\uc785\ub2c8\ub2e4. \uadf8 \ubaa9\uc801\uc740 \ucffc\ub9ac\uac00 \uae30\uc874 \uc778\ub371\uc2a4\uc5d0\uc11c \uc778\ub371\uc2a4\uc758 \uc120\ud589 \ud0a4\uc640 \uc77c\uce58\ud574\uc57c \ud558\ub294 \ubc88\uac70\ub85c\uc6c0\uc744 \ud53c\ud558\uae30 \uc704\ud55c \uac83\uc785\ub2c8\ub2e4.<\/span><\/p>\n<p><span style=\"font-weight: 400\">\uc801\uc751\ud615 \uc778\ub371\uc2a4\uc5d0\ub294 \ub450 \uac00\uc9c0 \uc7a5\uc810\uc774 \uc788\uc2b5\ub2c8\ub2e4:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">\ud0a4 \uacf5\uac04\uc758 \uc5ec\ub7ec \uc220\uc5b4\ub294 \ub3d9\uc77c\ud55c \uc778\ub371\uc2a4\uc758 \ub2e4\ub978 \uc139\uc158\uc744 \uc0ac\uc6a9\ud558\uc5ec \ud3c9\uac00\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">\uc778\ub371\uc2a4 \ud0a4\ub97c \uc7ac\uc815\ub82c\ud558\uae30 \uc704\ud574 \uc778\ub371\uc2a4\ub97c \uc5ec\ub7ec \uac1c \ub9cc\ub4e4\uc9c0 \ub9c8\uc138\uc694.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">\uc778\ub371\uc2a4 \ud0a4 \uc21c\uc11c\ub97c \ud53c\ud558\uc138\uc694.<\/span><\/li>\n<\/ul>\n<p>\uc608\uc2dc:<\/p>\n<pre class=\"font-size:17 line-height:20 wrap:true lang:mysql decode:true\">CREATE INDEX `ai_self`\r\n  ON `travel-sample`(DISTINCT PAIRS(ai_self))\r\n  WHERE type = \"airport\";\r\n\r\n  EXPLAIN SELECT * FROM `travel-sample`\r\n  WHERE faa = \"SFO\" \r\n    AND `type` = \"airport\";\r\n\r\n{\r\n  \"#operator\": \"IntersectScan\",\r\n  \"scans\": [\r\n    {\r\n      \"#operator\": \"IndexScan2\",\r\n      \"index\": \"ai_self\",\r\n      \"index_id\": \"c564a55225d9244c\",\r\n      \"index_projection\": {\r\n        \"primary_key\": true\r\n      },\r\n      \"keyspace\": \"travel-sample\",\r\n      \"namespace\": \"default\",\r\n      \"spans\": [\r\n        {\r\n          \"exact\": true,\r\n          \"range\": [\r\n            {\r\n              \"high\": \"[\\\"faa\\\", \\\"SFO\\\"]\",\r\n              \"inclusion\": 3,\r\n              \"low\": \"[\\\"faa\\\", \\\"SFO\\\"]\"\r\n            }\r\n          ]\r\n        }\r\n      ],\r\n      \"using\": \"gsi\"\r\n    }\r\n   ...\r\n  ]\r\n}<\/pre>\n<p><span style=\"font-weight: 400\">\ub2e4\ub978 \uc220\uc5b4\uac00 \ud3ec\ud568\ub41c \ucffc\ub9ac\uc5d0\ub3c4 \ub3d9\uc77c\ud55c \uc778\ub371\uc2a4\ub97c \uc0ac\uc6a9\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc774\ub807\uac8c \ud558\uba74 \ubb38\uc11c\uac00 \ucee4\uc9d0\uc5d0 \ub530\ub77c \uc0dd\uc131\ud574\uc57c \ud558\ub294 \uc778\ub371\uc2a4\uc758 \uc218\ub97c \uc904\uc77c \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<pre class=\"font-size:17 line-height:20 lang:mysql decode:true\">EXPLAIN SELECT * \r\n  FROM `travel-sample` \r\n  WHERE city = \"Seattle\" \r\n    AND `type` = \"airport\";\r\n<\/pre>\n<p><span style=\"font-weight: 400\">\uc0ac\uc6a9 \uc2dc \uace0\ub824 \uc0ac\ud56d<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">\uac01 \uc18d\uc131 \ud544\ub4dc\uc5d0\ub294 \uc778\ub371\uc2a4 \ud56d\ubaa9\uc774 \uc788\uc73c\ubbc0\ub85c \uc778\ub371\uc2a4\uc758 \ud06c\uae30\uac00 \ub9e4\uc6b0 \ud074 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">\uc801\uc751\ud615 \uc778\ub371\uc2a4\ub294 \ubc30\uc5f4 \uc778\ub371\uc2a4\uc785\ub2c8\ub2e4. \ubc30\uc5f4 \uc778\ub371\uc2a4\uc758 \uc81c\ud55c\uc5d0 \ubb36\uc5ec \uc788\uc2b5\ub2c8\ub2e4.<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400\">\uc790\uc138\ud55c \ub0b4\uc6a9\uc740 \ub2e4\uc74c \ubb38\uc11c\ub97c \ucc38\uc870\ud558\uc138\uc694.<\/span><a href=\"https:\/\/developer.couchbase.com\/documentation\/server\/5.0\/n1ql\/n1ql-language-reference\/adaptive-indexing.html#untitled1\"> <span style=\"font-weight: 400\">\uc801\uc751\ud615 \uc778\ub371\uc2a4<\/span><\/a><span style=\"font-weight: 400\"> \ub97c \ucc38\uc870\ud558\uc138\uc694.<\/span><\/p>\n<h3><b>9. \uc911\ubcf5 \uc0c9\uc778<\/b><\/h3>\n<p><span style=\"font-weight: 400\">\uc774\uac83\uc740 \uc2e4\uc81c\ub85c \ud2b9\ubcc4\ud55c \uc720\ud615\uc758 \uc778\ub371\uc2a4\uac00 \uc544\ub2c8\ub77c Couchbase \uc778\ub371\uc2f1\uc758 \uae30\ub2a5\uc785\ub2c8\ub2e4. \uace0\uc720\ud55c \uc774\ub984\uc744 \uac00\uc9c4 \uc911\ubcf5 \uc778\ub371\uc2a4\ub97c \ub9cc\ub4e4 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<pre class=\"font-size:17 line-height:20 wrap:true lang:mysql decode:true\">CREATE INDEX i1 \r\n  ON `travel-sample`(LOWER(name),id, icoo) \r\n  WHERE type = \u2018airline\u2019;\r\n\r\nCREATE INDEX i2 \r\n  ON `travel-sample`(LOWER(name),id, icoo) \r\n  WHERE type = \u2018airline\u2019;\r\n\r\nCREATE INDEX i3 \r\n  ON `travel-sample`(LOWER(name),id, icoo) \r\n  WHERE type = \u2018airline\u2019;<\/pre>\n<p><span style=\"font-weight: 400\">\uc138 \uc778\ub371\uc2a4 \ubaa8\ub450 \ub3d9\uc77c\ud55c \ud0a4, \ub3d9\uc77c\ud55c WHERE \uc808\uc744 \uac00\uc9c0\uace0 \uc788\uc73c\uba70 \uc720\uc77c\ud55c \ucc28\uc774\uc810\uc740 \uc778\ub371\uc2a4\uc758 \uc774\ub984\uc785\ub2c8\ub2e4. CREATE INDEX\uc758 WITH \uc808\uc744 \uc0ac\uc6a9\ud558\uc5ec \uc2e4\uc81c \uc704\uce58\ub97c \uc120\ud0dd\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \ucffc\ub9ac \ucd5c\uc801\ud654 \uc911\uc5d0 \ucffc\ub9ac\ub294 \uc774\ub984 \uc911 \ud558\ub098\ub97c \uc120\ud0dd\ud569\ub2c8\ub2e4. \uacc4\ud68d\uc5d0\uc11c \uc774\ub97c \ud655\uc778\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \ucffc\ub9ac \ub7f0\ud0c0\uc784 \uc911\uc5d0 \uc774\ub7ec\ud55c \uc778\ub371\uc2a4\ub294 \ub85c\ub4dc\ub97c \ubd84\uc0b0\ud558\uae30 \uc704\ud574 \ub77c\uc6b4\ub4dc \ub85c\ube48 \ubc29\uc2dd\uc73c\ub85c \uc0ac\uc6a9\ub429\ub2c8\ub2e4. \uc774\ub97c \ud1b5\ud574 \uc2a4\ucf00\uc77c \uc544\uc6c3, \ub2e4\ucc28\uc6d0 \ud655\uc7a5, \uc131\ub2a5 \ubc0f \uace0\uac00\uc6a9\uc131\uc744 \uc81c\uacf5\ud569\ub2c8\ub2e4. \ub098\uc058\uc9c0 \uc54a\uc8e0!<\/span><\/p>\n<p><span style=\"font-weight: 400\">Couchbase 5.0\uc5d0\uc11c\ub294 \uc911\ubcf5 \uc778\ub371\uc2a4\uac00 \ub354 \uac04\ub2e8\ud574\uc84c\uc2b5\ub2c8\ub2e4. \uace0\uc720\ud55c \uc774\ub984\uc744 \uac00\uc9c4 \uc778\ub371\uc2a4\ub97c \uc5ec\ub7ec \uac1c \uc0dd\uc131\ud558\ub294 \ub300\uc2e0 \ud544\uc694\ud55c \ubcf5\uc81c \uc778\ub371\uc2a4\uc758 \uc218\ub9cc \uc9c0\uc815\ud558\uba74 \ub429\ub2c8\ub2e4.<\/span><\/p>\n<pre class=\"wrap:true lang:mysql decode:true\">CREATE INDEX i1 \r\n  ON `travel-sample`(LOWER(name),id, icoo) \r\n  WHERE type = \u2018airline\u2019 \r\n  WITH {\"num_replica\" : 2 };\r\n<\/pre>\n<p><span style=\"font-weight: 400\">\uc774\ub807\uac8c \ud558\uba74 \uc778\ub371\uc2a4 i1 \uc678\uc5d0 2\uac1c\uc758 \uc778\ub371\uc2a4 \ubcf5\uc0ac\ubcf8\uc774 \ucd94\uac00\ub85c \uc0dd\uc131\ub429\ub2c8\ub2e4. \ub85c\ub4dc \ubc38\ub7f0\uc2f1 \ubc0f HA \uae30\ub2a5\uc740 \ub3d9\ub4f1\ud55c \uc778\ub371\uc2a4\uc640 \ub3d9\uc77c\ud569\ub2c8\ub2e4.<\/span><\/p>\n<p><b>10. \ucee4\ubc84\ub9c1 \uc778\ub371\uc2a4<\/b><\/p>\n<p><span style=\"font-weight: 400\">\ucffc\ub9ac\uc5d0 \ub300\ud55c \uc778\ub371\uc2a4 \uc120\ud0dd\uc740 \uc804\uc801\uc73c\ub85c \ucffc\ub9ac\uc758 WHERE \uc808\uc5d0 \uc788\ub294 \ud544\ud130\uc5d0 \ub530\ub77c \ub2ec\ub77c\uc9d1\ub2c8\ub2e4. \uc778\ub371\uc2a4 \uc120\ud0dd\uc774 \uc644\ub8cc\ub418\uba74 \uc5d4\uc9c4\uc740 \ucffc\ub9ac\ub97c \ubd84\uc11d\ud558\uc5ec \uc778\ub371\uc2a4\uc758 \ub370\uc774\ud130\ub9cc \uc0ac\uc6a9\ud558\uc5ec \ub2f5\ubcc0\ud560 \uc218 \uc788\ub294\uc9c0 \ud655\uc778\ud569\ub2c8\ub2e4. \uac00\ub2a5\ud558\ub2e4\uba74 \ucffc\ub9ac \uc5d4\uc9c4\uc740 \uc804\uccb4 \ubb38\uc11c \uac80\uc0c9\uc744 \uac74\ub108\ub701\ub2c8\ub2e4. \uc774\uac83\uc740 \uc778\ub371\uc2a4\ub97c \uc124\uacc4\ud560 \ub54c \uace0\ub824\ud574\uc57c \ud560 \uc131\ub2a5 \ucd5c\uc801\ud654\uc785\ub2c8\ub2e4.<\/span><\/p>\n<p><b>\uc9c0\uae08 \ubaa8\ub450 \ud568\uaed8!<\/b><\/p>\n<p><span style=\"font-weight: 400\">\uc774\uc81c \ubd84\ud560\ub41c \ubcf5\ud569 \ud568\uc218\ud615 \ubc30\uc5f4 \uc778\ub371\uc2a4\ub97c \uc870\ud569\ud574 \ubcf4\uaca0\uc2b5\ub2c8\ub2e4!<\/span><\/p>\n<pre class=\"font-size:17 line-height:20 wrap:true lang:mysql decode:true\">CREATE INDEX travel_all ON `travel-sample`(\r\n  iata,\r\n  LOWER(name),\r\n  UPPER(callsign),\r\n  ALL DISTINCT ARRAY p.model FOR p IN jets END),\r\n  TO_NUMBER(rating),\r\n  meta().id\r\n)\r\nWHERE LOWER(country) = \"united states\" AND type = \"airline\"\r\nWITH {\"num_replica\" : 2}<\/pre>\n<h2><strong>\uc778\ub371\uc2a4 \uc0dd\uc131 \uaddc\uce59.<\/strong><\/h2>\n<p>\uc9c0\uae08\uae4c\uc9c0 \uc778\ub371\uc2a4\uc758 \uc720\ud615\uc5d0 \ub300\ud574 \uc0b4\ud3b4\ubcf4\uc558\uc2b5\ub2c8\ub2e4. \uc774\uc81c \uc6cc\ud06c\ub85c\ub4dc\uc5d0 \ub9de\ub294 \uc778\ub371\uc2a4\ub97c \uc124\uacc4\ud558\ub294 \ubc29\ubc95\uc744 \uc0b4\ud3b4\ubcf4\uaca0\uc2b5\ub2c8\ub2e4.<\/p>\n<h3><span style=\"font-weight: 800\">\uaddc\uce59 #1: \ud0a4 \uc0ac\uc6a9<\/span><\/h3>\n<p><span style=\"font-weight: 400\">\uce74\uc6b0\uce58\ubca0\uc774\uc2a4\uc5d0\uc11c \ubc84\ud0b7\uc758 \uac01 \ubb38\uc11c\uc5d0\ub294 \uc0ac\uc6a9\uc790\uac00 \uc0dd\uc131\ud55c \uace0\uc720 \ud0a4\uac00 \uc788\uc2b5\ub2c8\ub2e4. \ubb38\uc11c\ub294 \uc774 \ud0a4\ub97c \ud574\uc2f1\ud558\uc5ec \uc5ec\ub7ec \ub178\ub4dc\uc5d0 \ubd84\uc0b0\ub429\ub2c8\ub2e4( <\/span><a href=\"https:\/\/developer.couchbase.com\/documentation\/server\/current\/architecture\/core-data-access-vbuckets-bucket-partition.html\"><span style=\"font-weight: 400\">\uc77c\uad00\ub41c \ud574\uc2f1<\/span><\/a><span style=\"font-weight: 400\">). \ubb38\uc11c \ud0a4\uac00 \uc788\uc73c\uba74 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc5d0\uc11c \uc9c1\uc811 \ubb38\uc11c\ub97c \uac00\uc838\uc62c \uc218 \uc788\uc2b5\ub2c8\ub2e4(SDK\ub97c \ud1b5\ud574). \ubb38\uc11c \ud0a4\uac00 \uc788\ub354\ub77c\ub3c4 N1QL\uc744 \ud1b5\ud574 \ubb38\uc11c\ub97c \uac00\uc838\uc624\uace0 \uc77c\ubd80 \ud6c4\ucc98\ub9ac\ub97c \ud558\uace0 \uc2f6\uc744 \uc218\ub3c4 \uc788\uc2b5\ub2c8\ub2e4. \uc774\ub54c\ub294 USE KEYS \uba54\uc11c\ub4dc\ub97c \uc0ac\uc6a9\ud569\ub2c8\ub2e4.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-4207 aligncenter\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/11\/Screen-Shot-2017-11-06-at-5.47.49-PM-300x227.png\" alt=\"\" width=\"300\" height=\"227\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/11\/Screen-Shot-2017-11-06-at-5.47.49-PM-300x227.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/11\/Screen-Shot-2017-11-06-at-5.47.49-PM-20x15.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/11\/Screen-Shot-2017-11-06-at-5.47.49-PM.png 368w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>\uc608\uc2dc:<\/p>\n<pre class=\"font-size:17 line-height:20 wrap:true lang:mysql decode:true\">SELECT name, address\r\nFROM `travel-sample` h USE KEYS [\r\n  \"hotel_10025\",\r\n  \"hotel_10026\",\r\n  \"hotel_10063\",\r\n  \"hotel_10064\",\r\n  \"hotel_10138\",\r\n  \"hotel_10142\",\r\n  \"hotel_10158\",\r\n  \"hotel_10159\",\r\n  \"hotel_10160\",\r\n  \"hotel_10161\",\r\n  \"hotel_10180\",\r\n  \"hotel_10289\",\r\n  \"hotel_10290\",\r\n  \"hotel_10291\",\r\n  \"hotel_1072\",\r\n  \"hotel_10848\",\r\n  \"hotel_10849\",\r\n  \"hotel_10850\",\r\n  \"hotel_10851\",\r\n  \"hotel_10904\"\r\n]\r\nWHERE  h.country = \"United Kingdom\"\r\nAND ARRAY_LENGTH(public_likes) &gt; 3;\r\n<\/pre>\n<p><span style=\"font-weight: 400\">USE KEYS \uc561\uc138\uc2a4 \ubc29\ubc95\uc740 \uc870\uc778\ud560 \ub54c\ub3c4 \uc0ac\uc6a9\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \ub2e4\uc74c\uc740 \uc608\uc2dc\uc785\ub2c8\ub2e4:<\/span><\/p>\n<p><span class=\"font-size:17 line-height:20 lang:mysql decode:true crayon-inline\">SELECT * FROM ORDERS o USE KEYS [&#8220;ord::382&#8221;] INNER JOIN CUSTOMER c ON KEYS o.id; <\/span><\/p>\n<p><span style=\"font-weight: 400\">\uce74\uc6b0\uce58\uc0c8 5.0\uc5d0\uc11c \uc778\ub371\uc2a4\ub294 \uac01 FROM \uc808\uc758 \uccab \ubc88\uc9f8 \ud0a4\uacf5\uac04(\ubc84\ud0b7)\uc744 \ucc98\ub9ac\ud558\ub294 \ub370\ub9cc \uc0ac\uc6a9\ub429\ub2c8\ub2e4. \uadf8 \uc774\ud6c4\uc758 \ud0a4 \uacf5\uac04\uc740 \ubb38\uc11c\ub97c \uc9c1\uc811 \uac00\uc838\uc640\uc11c \ucc98\ub9ac\ud569\ub2c8\ub2e4.<\/span><\/p>\n<p><span class=\"font-size:17 line-height:20 lang:mysql decode:true crayon-inline\">SELECT * FROM ORDERS o INNER JOIN CUSTOMER c ON KEYS o.id\u00a0WHERE o.state = &#8220;CA&#8221;; <\/span><\/p>\n<p><span style=\"font-weight: 400\">\uc774 \ubb38\uc5d0\uc11c\ub294 \uc0ac\uc6a9 \uac00\ub2a5\ud55c \uacbd\uc6b0 \uc778\ub371\uc2a4 \uc628(\uc0c1\ud0dc)\uc744 \ud1b5\ud574 ORDERS \ud0a4\uc2a4\ud398\uc774\uc2a4\ub97c \ucc98\ub9ac\ud569\ub2c8\ub2e4. \uadf8\ub807\uc9c0 \uc54a\uc73c\uba74 \uae30\ubcf8 \uc778\ub371\uc2a4\ub97c \uc0ac\uc6a9\ud558\uc5ec ORDERS\ub97c \uc2a4\uce94\ud569\ub2c8\ub2e4. \uadf8\ub7f0 \ub2e4\uc74c ORDERS \ubb38\uc11c\uc5d0\uc11c ID\uc640 \uc77c\uce58\ud558\ub294 CUSTOMER \ubb38\uc11c\ub97c \uac00\uc838\uc635\ub2c8\ub2e4.<\/span><\/p>\n<p><span style=\"font-weight: 800\">\uaddc\uce59 #2: \ucee4\ubc84\ub9c1 \uc778\ub371\uc2a4 \uc0ac\uc6a9\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400\">\uc774 \uae00\uc758 \uc55e\ubd80\ubd84\uc5d0\uc11c \uc778\ub371\uc2a4 \uc720\ud615\uc5d0 \ub300\ud574 \uc124\uba85\ud588\uc2b5\ub2c8\ub2e4. \uc62c\ubc14\ub978 \uc778\ub371\uc2a4\ub294 \ub450 \uac00\uc9c0 \uc6a9\ub3c4\ub85c \uc0ac\uc6a9\ub429\ub2c8\ub2e4:<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">\ucffc\ub9ac \uc791\uc5c5 \uc9d1\ud569\uc744 \uc904\uc5ec \ucffc\ub9ac \uc131\ub2a5 \uc18d\ub3c4 \ud5a5\uc0c1<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">\ucd94\uac00 \ub370\uc774\ud130\ub3c4 \uc800\uc7a5\ud558\uace0 \uc81c\uacf5\ud558\uc138\uc694.<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400\">\uc778\ub371\uc2a4\uc5d0 \uc800\uc7a5\ub41c \ub370\uc774\ud130\ub85c \ucffc\ub9ac\uc5d0 \ub300\ud55c \ub2f5\uc744 \uc644\uc804\ud788 \uc5bb\uc744 \uc218 \uc788\ub294 \uacbd\uc6b0, \ucffc\ub9ac\ub294 \ub2e4\uc74c\uacfc \uac19\ub2e4\uace0 \ud569\ub2c8\ub2e4. <\/span><i><span style=\"font-weight: 400\">\ucee4\ubc84 <\/span><\/i><span style=\"font-weight: 400\">\uc5d0 \uc758\ud574 <\/span><i><span style=\"font-weight: 400\">\ucee4\ubc84\ub9c1 \uc778\ub371\uc2a4. <\/span><\/i><span style=\"font-weight: 400\">\ucffc\ub9ac\uc758 \uc804\ubd80\ub294 \uc544\ub2c8\ub354\ub77c\ub3c4 \ub300\ubd80\ubd84\uc744 \ud3ec\ud568\ud558\ub3c4\ub85d \ud574\uc57c \ud569\ub2c8\ub2e4. \uc774\ub807\uac8c \ud558\uba74 \ucffc\ub9ac \uc11c\ube44\uc2a4\uc758 \ucc98\ub9ac \ubd80\ub2f4\uc774 \uc904\uc5b4\ub4e4\uace0 \ub370\uc774\ud130 \uc11c\ube44\uc2a4\uc5d0\uc11c \ucd94\uac00\ub85c \uac00\uc838\uc624\ub294 \uc791\uc5c5\uc774 \uc904\uc5b4\ub4ed\ub2c8\ub2e4.<\/span><\/p>\n<p><span style=\"font-weight: 400\">\uc778\ub371\uc2a4 \uc120\ud0dd\uc740 \uc5ec\uc804\ud788 \ucffc\ub9ac\uc758 \uc220\uc5b4\ub97c \uae30\ubc18\uc73c\ub85c \uc218\ud589\ub429\ub2c8\ub2e4. \uc778\ub371\uc2a4 \uc120\ud0dd\uc774 \uc644\ub8cc\ub418\uba74 \uc635\ud2f0\ub9c8\uc774\uc800\ub294 \uc778\ub371\uc2a4\uc5d0 \ucffc\ub9ac\uc5d0 \ud544\uc694\ud55c \ubaa8\ub4e0 \uc18d\uc131\uc774 \ud3ec\ud568\ub418\uc5b4 \uc788\ub294\uc9c0 \ud3c9\uac00\ud558\uace0 \ucee4\ubc84\ub41c \uc778\ub371\uc2a4 \uacbd\ub85c \uc561\uc138\uc2a4\ub97c \uc0dd\uc131\ud569\ub2c8\ub2e4.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-4206\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/11\/Screen-Shot-2017-11-06-at-6.04.08-PM-300x226.png\" alt=\"\" width=\"300\" height=\"226\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/11\/Screen-Shot-2017-11-06-at-6.04.08-PM-300x226.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/11\/Screen-Shot-2017-11-06-at-6.04.08-PM-20x15.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/11\/Screen-Shot-2017-11-06-at-6.04.08-PM.png 366w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>\uc608\uc2dc:<\/p>\n<pre class=\"font-size:17 line-height:20 wrap:true lang:mysql decode:true\">CREATE INDEX idx_cx3 \r\n  ON CUSTOMER(state, city, name.lastname) \r\n  WHERE status = 'premium';\r\n\r\n\/* The query below won\u2019t be covered since you said: SELECT * *\/\r\nSELECT * \r\n  FROM CUSTOMER\r\n  WHERE state = 'CA\u2019 \r\n    AND status = 'premium';\r\n\r\n\/* The index has all three fields required by the query. *\/\r\n\/* Query will be covered, as shown in the explain plan. *\/\r\n\r\nSELECT status, state, city \r\n  FROM CUSTOMER\r\n  WHERE state = 'CA' \r\n    AND status = 'premium';\r\n\r\n{\r\n  \"#operator\": \"IndexScan2\",\r\n  \"covers\": [\r\n    \"cover ((`CUSTOMER`.`state`))\",\r\n    \"cover ((`CUSTOMER`.`city`))\",\r\n    \"cover (((`CUSTOMER`.`name`).`lastname`))\",\r\n    \"cover ((meta(`CUSTOMER`).`id`))\"\r\n  ],\r\n  \"filter_covers\": {\r\n    \"cover ((`CUSTOMER`.`status`))\": \"premium\"\r\n  },\r\n  \"index\": \"idx_cx3\",\r\n  \"index_id\": \"18f8209144215971\",\r\n  \"index_projection\": {\r\n  \"entry_keys\": [\r\n    0,\r\n    1\r\n  ]\r\n}\r\n<\/pre>\n<p><span style=\"font-weight: 400\">\uc778\ub371\uc2a4\uc758 WHERE \uc808\uc5d0 \uc788\ub294 \uc0c1\ud0dc \ud544\ub4dc(status = 'premium')\ub3c4 \ud3ec\ud568\ub41c\ub2e4\ub294 \uc810\uc5d0 \uc720\uc758\ud558\uc138\uc694. \uc778\ub371\uc2a4\uc758 \ubaa8\ub4e0 \ubb38\uc11c\uc5d0\ub294 \uac12\uc774 'premium'\uc778 status\ub77c\ub294 \ud544\ub4dc\uac00 \uc788\ub2e4\ub294 \uac83\uc744 \uc54c\uace0 \uc788\uc2b5\ub2c8\ub2e4. \uc774 \uac12\uc744 \uac04\ub2e8\ud788 \ud22c\uc601\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc124\uba85\uc758 \"Filter_covers\" \ud544\ub4dc\uc5d0 \uc774 \uc815\ubcf4\uac00 \ud45c\uc2dc\ub429\ub2c8\ub2e4.<\/span><\/p>\n<p><span style=\"font-weight: 400\">\uc778\ub371\uc2a4\uc5d0 \ud544\ub4dc\uac00 \uc788\ub294 \ud55c, \ucffc\ub9ac\ub294 \uc804\uccb4 \ubb38\uc11c\ub97c \uac00\uc838\uc624\uc9c0 \uc54a\uace0\ub3c4 \uc778\ub371\uc11c\uc5d0\uc11c \ub370\uc774\ud130\ub97c \uac00\uc838\uc628 \ud6c4 \ucd94\uac00 \ud544\ud130\ub9c1, \uc870\uc778, \uc9d1\uacc4, \ud398\uc774\uc9c0 \ub9e4\uae40\uc744 \uc218\ud589\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<p><span style=\"font-weight: 800\">\uaddc\uce59 #3: \uc778\ub371\uc2a4 \ubcf5\uc81c \uc0ac\uc6a9 <\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4205\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/11\/Screen-Shot-2017-11-07-at-9.34.33-AM-300x112.png\" alt=\"\" width=\"567\" height=\"211\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/11\/Screen-Shot-2017-11-07-at-9.34.33-AM-300x112.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/11\/Screen-Shot-2017-11-07-at-9.34.33-AM-20x7.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/11\/Screen-Shot-2017-11-07-at-9.34.33-AM.png 714w\" sizes=\"auto, (max-width: 567px) 100vw, 567px\" \/><\/p>\n<p><span style=\"font-weight: 400\">Couchbase \ud074\ub7ec\uc2a4\ud130\uc5d0\ub294 \uc5ec\ub7ec \uc778\ub371\uc2a4 \uc11c\ube44\uc2a4\uac00 \uc788\uc2b5\ub2c8\ub2e4. Couchbase 5.0 \uc774\uc804\uc5d0\ub294 \uc218\ub3d9\uc73c\ub85c \ubcf5\uc81c\ubcf8(\ub4f1\uac00) \uc778\ub371\uc2a4\ub97c \ub9cc\ub4e4\uc5b4 \ucc98\ub9ac\ub7c9, \ub85c\ub4dc \ubc38\ub7f0\uc2f1 \ubc0f \uace0\uac00\uc6a9\uc131\uc744 \uac1c\uc120\ud560 \uc218 \uc788\uc5c8\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<p><span style=\"font-weight: 400\">5.0 \uc774\uc804 \ubc84\uc804:<\/span><\/p>\n<pre class=\"font-size:17 line-height:20 wrap:true lang:mysql decode:true\">CREATE INDEX idx1 \r\n  ON CUSTOMER(state, city, name.lastname) \r\n  WHERE status = 'premium';\r\nCREATE INDEX idx2 \r\n  ON CUSTOMER(state, city, name.lastname) \r\n  WHERE status = 'premium';\r\nCREATE INDEX idx3 \r\n  ON CUSTOMER(state, city, name.lastname) \r\n  WHERE status = 'premium';\r\n<\/pre>\n<p><span style=\"font-weight: 400\">\uc774 \uc138 \uc778\ub371\uc2a4\uc758 \ub3d9\ub4f1\uc131\uc744 \uc778\uc815\ud558\ub294 \uc774\uc720\ub294 \ud575\uc2ec \ud45c\ud604\uc2dd\uacfc WHERE \uc808\uc774 \ub2e4\uc74c\uacfc \uac19\uae30 \ub54c\ubb38\uc785\ub2c8\ub2e4. <\/span><b>\uc815\ud655\ud788<\/b><span style=\"font-weight: 400\"> \ub3d9\uc77c\ud569\ub2c8\ub2e4.<\/span><\/p>\n<p><span style=\"font-weight: 400\">\ucffc\ub9ac \ucd5c\uc801\ud654 \ub2e8\uacc4\uc5d0\uc11c N1QL \uc5d4\uc9c4\uc740 \ucffc\ub9ac \uacc4\ud68d\uc744 \uc0dd\uc131\ud558\uae30 \uc704\ud574 \uc778\ub371\uc2a4 \uc2a4\uce94\uc744 \uc704\ud55c \uc138 \uac1c\uc758 \uc778\ub371\uc2a4 \uc911 \ud558\ub098\ub97c \uc120\ud0dd\ud569\ub2c8\ub2e4(\ub2e4\ub978 \uc694\uad6c \uc0ac\ud56d\uc774 \ucda9\uc871\ub41c\ub2e4\ub294 \uac00\uc815 \ud558\uc5d0). \ucffc\ub9ac \uc2e4\ud589 \uc911\uc5d0 \ucffc\ub9ac\ub294 \uc2a4\uce94 \ud328\ud0a4\uc9c0\ub97c \uc900\ube44\ud558\uace0 \uc778\ub371\uc2a4 \uc2a4\uce94 \uc694\uccad\uc744 \ubcf4\ub0c5\ub2c8\ub2e4. \uc774 \uacfc\uc815\uc5d0\uc11c \ub85c\ub4dc \ud1b5\uacc4\uc5d0 \ub530\ub77c \uadf8 \uc911 \ud55c \uacf3\uc73c\ub85c \uc694\uccad\uc744 \ubcf4\ub0c5\ub2c8\ub2e4. \uc2dc\uac04\uc774 \uc9c0\ub0a8\uc5d0 \ub530\ub77c \uac01 \uc778\ub371\uc2a4\ub294 \ube44\uc2b7\ud55c \ubd80\ud558\ub97c \uac16\uac8c \ub420 \uac83\uc785\ub2c8\ub2e4.<\/span><\/p>\n<p><span style=\"font-weight: 400\">\ubcf5\uc81c \uc778\ub371\uc2a4(\ub3d9\ub4f1\ud55c \uc778\ub371\uc2a4)\ub97c \ub9cc\ub4dc\ub294 \uc774 \ud504\ub85c\uc138\uc2a4\ub294 \uac04\ub2e8\ud55c \ub9e4\uac1c\ubcc0\uc218\ub97c \uc0ac\uc6a9\ud558\uc5ec \ub354 \uc27d\uac8c \uc218\ud589\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<pre class=\"font-size:17 line-height:20 wrap:true lang:mysql decode:true\">CREATE INDEX idx1 \r\n  ON CUSTOMER(state, city, name.lastname)\r\n  WHERE status = 'premium' \r\n  WITH { \"num_replica\":2 };<\/pre>\n<p><span style=\"font-weight: 400\">\uc774\ub294 \uc11c\ub85c \ub2e4\ub974\uc9c0\ub9cc \ub3d9\uc77c\ud55c \uc778\ub371\uc2a4 \uc138 \uac1c\ub97c \uc0dd\uc131\ud558\ub294 \uac83\uacfc \uac19\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<p><span style=\"font-weight: 800\">\uaddc\uce59 #4: \ubc84\ud0b7\/\ud0a4 \uacf5\uac04\uc774 \uc544\ub2cc \uc6cc\ud06c\ub85c\ub4dc \uae30\uc900 \uc778\ub371\uc2f1<\/span><\/p>\n<p><span style=\"font-weight: 400\">\uac01 \ucffc\ub9ac\uc5d0 \ub300\ud55c \uc804\uccb4 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \uc6cc\ud06c\ub85c\ub4dc\uc640 \uc11c\ube44\uc2a4 \uc218\uc900 \uacc4\uc57d(SLA)\uc744 \uace0\ub824\ud558\uc138\uc694. \ucc98\ub9ac\ub7c9\uc774 \ub9ce\uace0 \ubc00\ub9ac\ucd08\uc758 \uc9c0\uc5f0 \uc2dc\uac04\uc774 \uc694\uad6c\ub418\ub294 \ucffc\ub9ac\uc5d0\ub294 \uc0ac\uc6a9\uc790 \uc815\uc758 \ubc0f \ubcf5\uc81c \uc778\ub371\uc2a4\uac00 \ud544\uc694\ud558\uc9c0\ub9cc, \ub2e4\ub978 \ucffc\ub9ac\uc5d0\ub294 \uc778\ub371\uc2a4\ub97c \uacf5\uc720\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. <\/span><\/p>\n<p><span style=\"font-weight: 400\">\ub2e8\uc21c\ud788 \uc124\uc815 \ubc0f \uac00\uc838\uc624\uae30 \uc791\uc5c5\uc744 \uc218\ud589\ud558\uac70\ub098 USE KEYS\ub85c \ucffc\ub9ac\ub97c \uc2e4\ud589\ud560 \uc218 \uc788\ub294 \ud0a4\uc2a4\ud398\uc774\uc2a4\uac00 \uc788\uc744 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc774\ub7ec\ud55c \ud0a4\uc2a4\ud398\uc774\uc2a4\uc5d0\ub294 \uc778\ub371\uc2a4\uac00 \ud544\uc694\ud558\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<p><span style=\"font-weight: 400\">\ucffc\ub9ac\ub97c \ubd84\uc11d\ud558\uc5ec \uacf5\ud1b5 \uc220\uc5b4, \ud0a4 \uc2a4\ud398\uc774\uc2a4\uc758 \ud22c\uc601\uc744 \ucc3e\uc2b5\ub2c8\ub2e4. \uacf5\ud1b5 \uc220\uc5b4\ub97c \uae30\ubc18\uc73c\ub85c \uc778\ub371\uc2a4 \uc218\ub97c \ucd5c\uc801\ud654\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \ucffc\ub9ac \uc911 \ud558\ub098\uc5d0 \uc120\ud589 \ud0a4\uc5d0 \uc220\uc5b4\uac00 \uc5c6\ub294 \uacbd\uc6b0, \uc778\ub371\uc2a4\ub97c \uacf5\uc720\ud560 \uc218 \uc788\ub3c4\ub85d (\ud544\ub4dc\uac00 \ub204\ub77d\ub418\uc9c0 \uc54a\uc74c) \ucd94\uac00\ud558\ub294 \uac83\uc774 \ud569\ub2f9\ud55c\uc9c0 \ud655\uc778\ud558\uc138\uc694.<\/span><\/p>\n<p><span style=\"font-weight: 400\">\uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc774\ub098 \ucffc\ub9ac\ub97c \uac1c\ubc1c\ud558\ub294 \ub3d9\uc548 \uae30\ubcf8 \uc778\ub371\uc2a4\ub97c \uc0ac\uc6a9\ud558\ub294 \uac83\uc740 \uad1c\ucc2e\uc2b5\ub2c8\ub2e4. \uadf8\ub7ec\ub098 \ud14c\uc2a4\ud2b8\ud558\uae30 \uc804\uc5d0 '\uae30\ubcf8 \uc778\ub371\uc2a4' \uc139\uc158\uc5d0 \uc124\uba85\ub41c \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \uc0ac\uc6a9 \uc0ac\ub840\uac00 \uc544\ub2c8\ub77c\uba74 \uc62c\ubc14\ub978 \uc778\ub371\uc2a4\ub97c \uc0dd\uc131\ud558\uace0 \uc2dc\uc2a4\ud15c\uc5d0\uc11c \uae30\ubcf8 \uc778\ub371\uc2a4\ub97c \uc0ad\uc81c\ud558\uc138\uc694. \ud504\ub85c\ub355\uc158 \ud658\uacbd\uc5d0 \uae30\ubcf8 \uc778\ub371\uc2a4\uac00 \uc788\uace0 \ucffc\ub9ac\uac00 \uc778\ub371\uc2a4\uc758 \uc804\uccb4 \uc2a4\ud32c\uc73c\ub85c \uc804\uccb4 \uae30\ubcf8 \uc2a4\uce94\uc744 \uc218\ud589\ud558\uac8c \ub418\uba74 \ubb38\uc81c\uac00 \ubc1c\uc0dd\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. Couchbase\uc5d0\uc11c \uae30\ubcf8 \uc778\ub371\uc2a4\ub294 \ubc84\ud0b7\uc758 \ubaa8\ub4e0 \ubb38\uc11c\ub97c \uc0c9\uc778\ud569\ub2c8\ub2e4.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Couchbase\uc758 \ubaa8\ub4e0 \ubcf4\uc870 \uc778\ub371\uc2a4\uc5d0\ub294 \ucd5c\uc18c\ud55c \ubb38\uc11c \uc720\ud615\uc5d0 \ub300\ud55c \uc870\uac74\uc774 \uc788\ub294 WHERE \uc808\uc774 \uc788\uc5b4\uc57c \ud569\ub2c8\ub2e4. \uc774\uac83\uc740 \uc2dc\uc2a4\ud15c\uc5d0 \uc758\ud574 \uac15\uc81c\ub418\uc9c0\ub294 \uc54a\uc9c0\ub9cc \uc88b\uc740 \uc124\uacc4\uc785\ub2c8\ub2e4.<\/span><\/p>\n<pre class=\"font-size:17 line-height:20 wrap:true lang:mysql decode:true\">CREATE INDEX def_route_src_dst \r\n ON `travel-sample` (`sourceairport`, `destinationairport`) \r\n WHERE (`type` = \"route\");\r\n<\/pre>\n<p><span style=\"font-weight: 400\">\uc62c\ubc14\ub978 \uc778\ub371\uc2a4\ub97c \ub9cc\ub4dc\ub294 \uac83\uc740 \uc131\ub2a5 \ucd5c\uc801\ud654\ub97c \uc704\ud55c \ubaa8\ubc94 \uc0ac\ub840 \uc911 \ud558\ub098\uc785\ub2c8\ub2e4. \ucd5c\uc0c1\uc758 \uc131\ub2a5\uc744 \uc5bb\uae30 \uc704\ud574 \ud574\uc57c \ud560 \uc77c\uc740 \uc774\uac83\ubfd0\ub9cc\uc774 \uc544\ub2d9\ub2c8\ub2e4. \ud074\ub7ec\uc2a4\ud130 \uad6c\uc131, \ud29c\ub2dd, SDK \uad6c\uc131, \uc900\ube44\ub41c \ubb38 \uc0ac\uc6a9 \ub4f1\uc774 \ubaa8\ub450 \uc911\uc694\ud55c \uc5ed\ud560\uc744 \ud569\ub2c8\ub2e4.<\/span><\/p>\n<p><span style=\"font-weight: 800\">\uaddc\uce59 #5: \uc608\uc0c1\uc774 \uc544\ub2cc \uc608\uce21\uc73c\ub85c \uc778\ub371\uc2f1\ud558\uae30<\/span><\/p>\n<p><span style=\"font-weight: 400\">\uc774\uac83\uc740 \ub2f9\uc5f0\ud55c \uaddc\uce59\ucc98\ub7fc \ubcf4\uc785\ub2c8\ub2e4. \ud558\uc9c0\ub9cc \uac00\ub054\uc529 \uc774\ub7f0 \uc2e4\uc218\ub97c \ud558\ub294 \uc0ac\ub78c\ub4e4\uc744 \ub9cc\ub098\uac8c \ub429\ub2c8\ub2e4.<\/span><\/p>\n<p><span style=\"font-weight: 400\">\ucffc\ub9ac\ub97c \uc0dd\uac01\ud574 \ubcf4\uc138\uc694:<\/span><\/p>\n<pre class=\"font-size:17 line-height:20 wrap:true lang:mysql decode:true\">SELECT city, state, status \r\n  FROM CUSTOMER \r\n  WHERE state = 'CA' \r\n    AND status = 'premium';\r\n<\/pre>\n<p><span style=\"font-weight: 400\">\ucffc\ub9ac\uc5d0\uc11c \ub2e4\uc74c \uc778\ub371\uc2a4 \uc911 \ud558\ub098\ub97c \uc0ac\uc6a9\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4:<\/span><\/p>\n<pre class=\"font-size:17 line-height:20 wrap:true lang:mysql decode:true\">Create index i1 on CUSTOMER(state);\r\nCreate index i2 on CUSTOMER(status);\r\nCreate index i3 on CUSTOMER(state, status);\r\nCreate index i4 on CUSTOMER(status, state);\r\nCreate index i5 on CUSTOMER(state) WHERE status = \u201cpremium\u201d;\r\nCreate index i6 on CUSTOMER(status) WHERE status = \u201cCA\u201d;<\/pre>\n<p>\uc778\ub371\uc2a4\uac00 \ucffc\ub9ac\ub97c \uc644\uc804\ud788 \ud3ec\ud568\ud558\ub3c4\ub85d \ud558\ub824\uba74 \uc778\ub371\uc2a4 3-6\uc5d0 \ub3c4\uc2dc \ud544\ub4dc\ub97c \ucd94\uac00\ud558\uae30\ub9cc \ud558\uba74 \ub429\ub2c8\ub2e4.<\/p>\n<p>\uadf8\ub7ec\ub098 \ub3c4\uc2dc\ub97c \uc120\ud589 \ud0a4\ub85c \uc0ac\uc6a9\ud558\ub294 \uc778\ub371\uc2a4\uac00 \uc788\ub294 \uacbd\uc6b0 \ucd5c\uc801\ud654 \ub3c4\uad6c\ub294 \ud574\ub2f9 \uc778\ub371\uc2a4\ub97c \uc120\ud0dd\ud558\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4.<\/p>\n<pre class=\"font-size:17 line-height:20 lang:mysql decode:true\">Create index i7 O\r\n  ON CUSTOMER(city, state) \r\n  WHERE status = \u201cpremium\u201d;\r\n<\/pre>\n<p><span style=\"font-weight: 400\">\uc778\ub371\uc2a4\ub97c \ucd5c\uc801\ud654\ud558\uae30 \uc704\ud574 \ub2e4\uc591\ud55c \uc2dc\ub098\ub9ac\uc624\uc5d0\uc11c \uc778\ub371\uc2a4 \uc2a4\uce94\uc774 \uc5b4\ub5bb\uac8c \uc791\ub3d9\ud558\ub294\uc9c0\uc5d0 \ub300\ud55c \uc790\uc138\ud55c \ub3c4\uc6c0\ub9d0\uc744 \ucc38\uc870\ud558\uc138\uc694: <\/span><a href=\"https:\/\/dzone.com\/articles\/understanding-index-scans-in-couchbase-50-n1ql-que\"><span style=\"font-weight: 400\">https:\/\/dzone.com\/articles\/understanding-index-scans-in-couchbase-50-n1ql-que<\/span><\/a><\/p>\n<p><span style=\"font-weight: 800\">\uaddc\uce59 #6: SLA\ub97c \ucda9\uc871\ud558\uae30 \uc704\ud574 \uc778\ub371\uc2a4 \ucd94\uac00\ud558\uae30 <\/span><\/p>\n<p><span style=\"font-weight: 400\">\uad00\uacc4\ud615 \ub370\uc774\ud130\ubca0\uc774\uc2a4\uc758 \uacbd\uc6b0 \uc131\ub2a5, \uc131\ub2a5, \uc131\ub2a5 \uc774 \uc138 \uac00\uc9c0\uac00 \uac00\uc7a5 \uc911\uc694\ud588\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<p><span style=\"font-weight: 400\">NoSQL \ub370\uc774\ud130\ubca0\uc774\uc2a4\uc758 \uacbd\uc6b0 \uaddc\ubaa8\uc5d0 \ub9de\ub294 \uc131\ub2a5, \uaddc\ubaa8\uc5d0 \ub9de\ub294 \uc131\ub2a5, \uaddc\ubaa8\uc5d0 \ub9de\ub294 \uc131\ub2a5\uc774\ub77c\ub294 \uc138 \uac00\uc9c0\uac00 \uac00\uc7a5 \uc911\uc694\ud569\ub2c8\ub2e4.<\/span><\/p>\n<p><span style=\"font-weight: 400\">\ub178\ud2b8\ubd81\uc5d0\uc11c \uae30\ubcf8\uc801\uc778 \uc131\ub2a5 \ud14c\uc2a4\ud2b8\ub97c \uc2e4\ud589\ud558\ub294 \ucffc\ub9ac\uc640 \ud074\ub7ec\uc2a4\ud130\uc5d0\uc11c \ucc98\ub9ac\ub7c9\uc774 \ub9ce\uace0 \uc9c0\uc5f0 \uc2dc\uac04\uc774 \uc9e7\uc740 \ucffc\ub9ac\ub97c \uc2e4\ud589\ud558\ub294 \uac83\uc740 \uc804\ud600 \ub2e4\ub978 \ubb38\uc81c\uc785\ub2c8\ub2e4. \ub2e4\ud589\ud788\ub3c4 Couchbase\uc5d0\uc11c\ub294 \ub2e4\ucc28\uc6d0 \ud655\uc7a5 \ub355\ubd84\uc5d0 \ubcd1\ubaa9 \ub9ac\uc18c\uc2a4\ub97c \uc27d\uac8c \uc2dd\ubcc4\ud558\uace0 \ub3c5\ub9bd\uc801\uc73c\ub85c \ud655\uc7a5\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. Couchbase\uc758 \uac01 \uc11c\ube44\uc2a4\ub294 \ub370\uc774\ud130, \uc778\ub371\uc2a4, \ucffc\ub9ac\ub77c\ub294 \ubcc4\uac1c\uc758 \uc11c\ube44\uc2a4\ub85c \ucd94\uc0c1\ud654\ub418\uc5b4 \uc788\uc2b5\ub2c8\ub2e4. Couchbase \ucf58\uc194\uc5d0\ub294 \uac01 \uc11c\ube44\uc2a4\uc5d0 \ub300\ud55c \ud1b5\uacc4\uac00 \ub3c5\ub9bd\uc801\uc73c\ub85c \uc81c\uacf5\ub429\ub2c8\ub2e4. <\/span><\/p>\n<p><span style=\"font-weight: 400\">\ucffc\ub9ac\uc5d0 \ub300\ud55c \uc778\ub371\uc2a4\ub97c \uc0dd\uc131\ud558\uace0 \uc6cc\ud06c\ub85c\ub4dc\uc5d0 \ub9de\uac8c \uc778\ub371\uc2a4\ub97c \ucd5c\uc801\ud654\ud55c \ud6c4\uc5d0\ub294 \ubcf5\uc81c \uc778\ub371\uc2a4 \uac04\uc5d0 \uc2a4\uce94\uc758 \ubd80\ud558\uac00 \ubd84\uc0b0\ub418\ubbc0\ub85c \ub300\uae30 \uc2dc\uac04\uc744 \uac1c\uc120\ud558\uae30 \uc704\ud574 \ubcf5\uc81c\ubcf8(\ub3d9\ub4f1\ud55c) \uc778\ub371\uc2a4\ub97c \ucd94\uac00\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. <\/span><\/p>\n<p><span style=\"font-weight: 800\">\uaddc\uce59 #7: \uc815\ub82c\uc744 \ud53c\ud558\uae30 \uc704\ud55c \uc778\ub371\uc2a4<\/span><\/p>\n<p><span style=\"font-weight: 400\">\uc778\ub371\uc2a4\uc5d0\ub294 \uc774\ubbf8 \uc778\ub371\uc2a4 \ud0a4\uc758 \uc815\ub82c\ub41c \uc21c\uc11c\ub300\ub85c \ub370\uc774\ud130\uac00 \uc788\uc2b5\ub2c8\ub2e4. \uc2a4\uce94 \ud6c4 \uc778\ub371\uc2a4\ub294 \uc778\ub371\uc2a4 \ud0a4 \uc21c\uc11c\ub300\ub85c \uacb0\uacfc\ub97c \ubc18\ud658\ud569\ub2c8\ub2e4.<\/span><\/p>\n<pre class=\"font-size:17 line-height:20 wrap:true lang:mysql decode:true\">CREATE INDEX idx3 \r\n  ON `travel-sample`(state, city, name.lastname)\r\n  WHERE status = 'premium';<\/pre>\n<p><span style=\"font-weight: 400\">\ub370\uc774\ud130\ub294 \uc8fc, \ub3c4\uc2dc, \uc774\ub984.\uc131\uc758 \uc21c\uc11c\ub85c \uc800\uc7a5\ub418\uace0 \ubc18\ud658\ub429\ub2c8\ub2e4. \ub530\ub77c\uc11c state, city, name.lastname\uc758 \uc21c\uc11c\ub85c \ub370\uc774\ud130\uac00 \uc608\uc0c1\ub418\ub294 \ucffc\ub9ac\uac00 \uc788\ub294 \uacbd\uc6b0 \uc778\ub371\uc2a4\ub97c \uc0ac\uc6a9\ud558\uba74 \uc815\ub82c\uc744 \ud53c\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<p><span style=\"font-weight: 400\">\uc544\ub798 \uc608\uc81c\uc5d0\uc11c\ub294 \uc778\ub371\uc2a4\uc758 \uc138 \ubc88\uc9f8 \ud0a4\uc778 name.lastname\uc744 \uae30\uc900\uc73c\ub85c \uacb0\uacfc\uac00 \uc815\ub82c\ub418\uc5b4 \uc788\uc2b5\ub2c8\ub2e4. \ub530\ub77c\uc11c name.lastname\uc744 \uae30\uc900\uc73c\ub85c \uacb0\uacfc \uc9d1\ud569\uc744 \uc815\ub82c\ud574\uc57c \ud569\ub2c8\ub2e4. \uc124\uba85\uc740 \uacc4\ud68d\uc5d0 \uc774 \uc815\ub82c\uc774 \ud544\uc694\ud55c\uc9c0 \uc5ec\ubd80\ub97c \uc54c\ub824\uc90d\ub2c8\ub2e4.<\/span><\/p>\n<pre class=\"font-size:17 line-height:20 wrap:true lang:mysql decode:true\">EXPLAIN SELECT state, city, name.lastname \r\n  FROM `travel-sample`\r\n  WHERE status = \u2018premium\u2019 \r\n    AND state = \u2018CA\u2019 \r\n    AND city LIKE \u2018san%\u2019\r\n  ORDER BY name.lastname;\r\n\r\n{\r\n  \"plan\": {\r\n    \"#operator\": \"Sequence\",\r\n    \"~children\": [\r\n      {\r\n        \"#operator\": \"Sequence\",\r\n        \"~children\": [\r\n          {\r\n            \"#operator\": \"IndexScan2\",\r\n            \"covers\": [\r\n              \"cover ((`travel-sample`.`state`))\",\r\n              \"cover ((`travel-sample`.`city`))\",\r\n              \"cover (((`travel-sample`.`name`).`lastname`))\",\r\n              \"cover ((meta(`travel-sample`).`id`))\"\r\n            ],\r\n            \"filter_covers\": {\r\n              \"cover ((`travel-sample`.`status`))\": \"premium\"\r\n            },\r\n            \"index\": \"idx3\",\r\n            \"index_id\": \"19a5aed899d281fe\",\r\n            \"index_projection\": {\r\n              \"entry_keys\": [\r\n                0,\r\n                1,\r\n                2\r\n              ]\r\n            },\r\n            \"keyspace\": \"travel-sample\",\r\n            \"namespace\": \"default\",\r\n            \"spans\": [\r\n              {\r\n                \"exact\": true,\r\n                \"range\": [\r\n                  {\r\n                    \"high\": \"\\\"CA\\\"\",\r\n                    \"inclusion\": 3,\r\n                    \"low\": \"\\\"CA\\\"\"\r\n                  },\r\n                  {\r\n                    \"high\": \"\\\"sao\\\"\",\r\n                    \"inclusion\": 1,\r\n                    \"low\": \"\\\"san\\\"\"\r\n                  }\r\n                ]\r\n              }\r\n            ],\r\n            \"using\": \"gsi\"\r\n          },\r\n          {\r\n            \"#operator\": \"Parallel\",\r\n            \"~child\": {\r\n              \"#operator\": \"Sequence\",\r\n              \"~children\": [\r\n                {\r\n                  \"#operator\": \"Filter\",\r\n                  \"condition\": \"(((cover ((`travel-sample`.`status`)) = \\\"premium\\\") and (cover ((`travel-sample`.`state`)) = \\\"CA\\\")) and (cover ((`travel-sample`.`city`)) like \\\"san%\\\"))\"\r\n                },\r\n                {\r\n                  \"#operator\": \"InitialProject\",\r\n                  \"result_terms\": [\r\n                    {\r\n                      \"expr\": \"cover ((`travel-sample`.`state`))\"\r\n                    },\r\n                    {\r\n                      \"expr\": \"cover ((`travel-sample`.`city`))\"\r\n                    },\r\n                    {\r\n                      \"expr\": \"cover (((`travel-sample`.`name`).`lastname`))\"\r\n                    }\r\n                  ]\r\n                }\r\n              ]\r\n            }\r\n          }\r\n        ]\r\n      },\r\n      {\r\n        \"#operator\": \"Order\",\r\n        \"sort_terms\": [\r\n          {\r\n            \"expr\": \"cover (((`travel-sample`.`name`).`lastname`))\"\r\n          }\r\n        ]\r\n      },\r\n      {\r\n        \"#operator\": \"FinalProject\"\r\n      }\r\n    ]\r\n  },\r\n  \"text\": \"SELECT state, city, name.lastname \\nFROM `travel-sample`\\nWHERE status = 'premium' AND state = 'CA' AND city LIKE 'san%'\\nORDER BY name.lastname;\"\r\n}\r\n<\/pre>\n<p><span style=\"font-weight: 400\">\uc544\ub798 \ucffc\ub9ac\ub294 \uc778\ub371\uc2a4 \ud0a4\uc640 \uc644\ubcbd\ud558\uac8c \uc77c\uce58\ud569\ub2c8\ub2e4.  \ub530\ub77c\uc11c \uc815\ub82c\uc774 \ud544\uc694\ud558\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4.  \uc124\uba85 \ucd9c\ub825\uc5d0\uc11c \uc8fc\ubb38 \uc5f0\uc0b0\uc790\uac00 \ub204\ub77d\ub418\uc5c8\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<pre class=\"font-size:17 line-height:20 wrap:true lang:mysql decode:true\">EXPLAIN SELECT state, city, name.lastname \r\nFROM `travel-sample`\r\nWHERE status = \u2018premium\u2019 \r\n  AND state = \u2018CA\u2019 \r\n  AND city LIKE \u2018san%\u2019\r\nORDER BY state, city, name.lastname;\r\n\r\n\r\n{\r\n  \"plan\": {\r\n    \"#operator\": \"Sequence\",\r\n    \"~children\": [\r\n      {\r\n        \"#operator\": \"Sequence\",\r\n        \"~children\": [\r\n          {\r\n            \"#operator\": \"IndexScan2\",\r\n            \"covers\": [\r\n              \"cover ((`travel-sample`.`state`))\",\r\n              \"cover ((`travel-sample`.`city`))\",\r\n              \"cover (((`travel-sample`.`name`).`lastname`))\",\r\n              \"cover ((meta(`travel-sample`).`id`))\"\r\n            ],\r\n            \"filter_covers\": {\r\n              \"cover ((`travel-sample`.`status`))\": \"premium\"\r\n            },\r\n            \"index\": \"idx3\",\r\n            \"index_id\": \"19a5aed899d281fe\",\r\n            \"index_projection\": {\r\n              \"entry_keys\": [\r\n                0,\r\n                1,\r\n                2\r\n              ]\r\n            },\r\n            \"keyspace\": \"travel-sample\",\r\n            \"namespace\": \"default\",\r\n            \"spans\": [\r\n              {\r\n                \"exact\": true,\r\n                \"range\": [\r\n                  {\r\n                    \"high\": \"\\\"CA\\\"\",\r\n                    \"inclusion\": 3,\r\n                    \"low\": \"\\\"CA\\\"\"\r\n                  },\r\n                  {\r\n                    \"high\": \"\\\"sao\\\"\",\r\n                    \"inclusion\": 1,\r\n                    \"low\": \"\\\"san\\\"\"\r\n                  }\r\n                ]\r\n              }\r\n            ],\r\n            \"using\": \"gsi\"\r\n          },\r\n          {\r\n            \"#operator\": \"Parallel\",\r\n            \"maxParallelism\": 1,\r\n            \"~child\": {\r\n              \"#operator\": \"Sequence\",\r\n              \"~children\": [\r\n                {\r\n                  \"#operator\": \"Filter\",\r\n                  \"condition\": \"(((cover ((`travel-sample`.`status`)) = \\\"premium\\\") and (cover ((`travel-sample`.`state`)) = \\\"CA\\\")) and (cover ((`travel-sample`.`city`)) like \\\"san%\\\"))\"\r\n                },\r\n                {\r\n                  \"#operator\": \"InitialProject\",\r\n                  \"result_terms\": [\r\n                    {\r\n                      \"expr\": \"cover ((`travel-sample`.`state`))\"\r\n                    },\r\n                    {\r\n                      \"expr\": \"cover ((`travel-sample`.`city`))\"\r\n                    },\r\n                    {\r\n                      \"expr\": \"cover (((`travel-sample`.`name`).`lastname`))\"\r\n                    }\r\n                  ]\r\n                },\r\n                {\r\n                  \"#operator\": \"FinalProject\"\r\n                }\r\n              ]\r\n            }\r\n          }\r\n        ]\r\n      }\r\n    ]\r\n  },\r\n  \"text\": \"SELECT state, city, name.lastname \\nFROM `travel-sample`\\nWHERE status = 'premium' AND state = 'CA' AND city LIKE 'san%'\\nORDER BY state, city, name.lastname;\"\r\n}\r\n<\/pre>\n<p><span style=\"font-weight: 400\">\ud398\uc774\uc9c0 \ub9e4\uae40 \uc0ac\uc6a9 \uc0ac\ub840\ub97c \ubcf4\uae30 \uc804\uae4c\uc9c0\ub294 \uc778\ub371\uc2a4 \uc815\ub82c \uc21c\uc11c\ub97c \ud65c\uc6a9\ud558\ub294 \uac83\uc774 \uc911\uc694\ud574 \ubcf4\uc774\uc9c0 \uc54a\uc744 \uc218 \uc788\uc2b5\ub2c8\ub2e4.  \ucffc\ub9ac\uc5d0 \uc624\ud504\uc14b\uacfc \uc81c\ud55c\uc744 \uc9c0\uc815\ud55c \uacbd\uc6b0, \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc774 \uc2e0\uacbd \uc4f0\uc9c0 \uc54a\uac70\ub098 \ud544\uc694\ud558\uc9c0 \uc54a\uc740 \ubb38\uc11c\ub97c \ud6a8\uc728\uc801\uc73c\ub85c \uc81c\uac70\ud558\uae30 \uc704\ud574 \uc778\ub371\uc2a4\ub97c \uc0ac\uc6a9\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.  \ud398\uc774\uc9c0 \ub9e4\uae40 \uc0ac\uc6a9 \uc0ac\ub840\ub294<\/span><a href=\"https:\/\/www.couchbase.com\/blog\/ko\/optimizing-database-pagination-using-couchbase-n1ql\/\"><span style=\"font-weight: 400\"> \ud398\uc774\uc9c0 \ub9e4\uae40\uc5d0 \ub300\ud55c \uc790\uc138\ud55c \ub0b4\uc6a9\uc740<\/span><\/a><span style=\"font-weight: 400\">.<\/span><\/p>\n<p><span style=\"font-weight: 400\">N1QL \uc635\ud2f0\ub9c8\uc774\uc800\ub294 \uba3c\uc800 \ucffc\ub9ac\uc758 \uc220\uc5b4(\ud544\ud130)\ub97c \uae30\ubc18\uc73c\ub85c \uc778\ub371\uc2a4\ub97c \uc120\ud0dd\ud55c \ub2e4\uc74c, \uc778\ub371\uc2a4\uac00 \ubaa8\ub4e0 \ucffc\ub9ac \ucc38\uc870\ub97c \ud22c\uc601 \ubc0f \uc21c\uc11c\ub300\ub85c \ucee4\ubc84\ud560 \uc218 \uc788\ub294\uc9c0 \ud655\uc778\ud569\ub2c8\ub2e4.  \uadf8 \ud6c4, \uc635\ud2f0\ub9c8\uc774\uc800\ub294 \uc815\ub82c\uc744 \uc81c\uac70\ud558\uace0 OFFSET \ubc0f LIMIT \ud478\uc2dc\ub2e4\uc6b4\uc744 \uacb0\uc815\ud558\ub824\uace0 \uc2dc\ub3c4\ud569\ub2c8\ub2e4.  \uc124\uba85\uc740 \uc624\ud504\uc14b\uacfc \uc81c\ud55c\uc774 \uc778\ub371\uc2a4 \uc2a4\uce94\uc73c\ub85c \ud478\uc2dc\ub418\uc5c8\ub294\uc9c0 \uc5ec\ubd80\ub97c \ubcf4\uc5ec\uc90d\ub2c8\ub2e4.<\/span><\/p>\n<pre class=\"font-size:17 line-height:30 lang:js decode:true\">\"keyspace\": \"travel-sample\",\r\n\"limit\": \"20\",\r\n\"namespace\": \"default\",\r\n\"offset\": \"100\",\r\n\"spans\": [\r\n  {\r\n    \"exact\": true,\r\n    \"range\": [\r\n      {\r\n        \"high\": \"\\\"CA\\\"\",\r\n        \"inclusion\": 3,\r\n        \"low\": \"\\\"CA\\\"\"\r\n      },\r\n      {\r\n        \"high\": \"\\\"sao\\\"\",\r\n        \"inclusion\": 1,\r\n        \"low\": \"\\\"san\\\"\"\r\n      }\r\n    ]\r\n  }\r\n]\r\n<\/pre>\n<p><span style=\"font-weight: 800\">\uaddc\uce59 #8: \uc778\ub371\uc2a4 \uc218<\/span><\/p>\n<p><span style=\"font-weight: 400\">\uc2dc\uc2a4\ud15c\uc5d0\uc11c \uac00\uc9c8 \uc218 \uc788\ub294 \uc778\ub371\uc2a4 \uc218\uc5d0\ub294 \uc778\uc704\uc801\uc778 \uc81c\ud55c\uc774 \uc5c6\uc2b5\ub2c8\ub2e4. \ub370\uc774\ud130\uac00 \uc788\ub294 \ubc84\ud0b7\uc5d0 \ub9ce\uc740 \uc218\uc758 \uc778\ub371\uc2a4\ub97c \uc0dd\uc131\ud558\ub294 \uacbd\uc6b0, \ub370\uc774\ud130 \uc11c\ube44\uc2a4\uc640 \uc778\ub371\uc2a4 \uc11c\ube44\uc2a4 \uac04\uc758 \ub370\uc774\ud130 \uc804\uc1a1\uc774 \ud6a8\uc728\uc801\uc73c\ub85c \uc774\ub8e8\uc5b4\uc9c8 \uc218 \uc788\ub3c4\ub85d \uc9c0\uc5f0\ub41c \ube4c\ub4dc \uc635\uc158\uc744 \uc0ac\uc6a9\ud558\uc138\uc694.<\/span><\/p>\n<p><span style=\"font-weight: 800\">\uaddc\uce59 #9: \uc0bd\uc785, \uc0ad\uc81c, \uc5c5\ub370\uc774\ud2b8 \uc911 \uc778\ub371\uc2f1<\/span><\/p>\n<p><span style=\"font-weight: 400\">\uc778\ub371\uc2a4\ub294 \ube44\ub3d9\uae30\uc801\uc73c\ub85c \uc720\uc9c0\ub429\ub2c8\ub2e4. \ud0a4-\uac12 API \ub610\ub294 N1QL \ubb38\uc744 \ud1b5\ud55c \ub370\uc774\ud130 \uc5c5\ub370\uc774\ud2b8\ub294 \ubc84\ud0b7\uc758 \ubb38\uc11c\ub9cc \uc5c5\ub370\uc774\ud2b8\ud569\ub2c8\ub2e4.  \uc778\ub371\uc2a4\ub294 \uc2a4\ud2b8\ub9bc\uc744 \ud1b5\ud574 \ubcc0\uacbd \uc54c\ub9bc\uc744 \uc218\uc2e0\ud558\uace0 \ubcc0\uacbd \uc0ac\ud56d\uc744 \uc778\ub371\uc2a4\uc5d0 \uc801\uc6a9\ud569\ub2c8\ub2e4. \ub2e4\uc74c\uc740 UPDATE \ubb38\uc758 \uc791\uc5c5 \uc21c\uc11c\uc785\ub2c8\ub2e4. \uc774 \ubb38\uc740 \uc778\ub371\uc2a4\ub97c \uc0ac\uc6a9\ud558\uc5ec \uc5c5\ub370\uc774\ud2b8\ud560 \ubb38\uc11c\ub97c \ud55c\uc815\ud558\uace0, \ubb38\uc11c\ub97c \uac00\uc838\uc640\uc11c \uc5c5\ub370\uc774\ud2b8\ud55c \ub2e4\uc74c, \ubb38\uc11c\ub97c \ub2e4\uc2dc \uc4f0\uace0 UPDATE \ubb38\uc5d0\uc11c \uc694\uccad\ud55c \ubaa8\ub4e0 \ub370\uc774\ud130\ub97c \ubc18\ud658\ud569\ub2c8\ub2e4.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4208\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2017\/11\/Screen-Shot-2017-11-10-at-10.22.38-PM-300x153.png\" alt=\"\" width=\"735\" height=\"375\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/11\/Screen-Shot-2017-11-10-at-10.22.38-PM-300x153.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/11\/Screen-Shot-2017-11-10-at-10.22.38-PM-1024x522.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/11\/Screen-Shot-2017-11-10-at-10.22.38-PM-768x391.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/11\/Screen-Shot-2017-11-10-at-10.22.38-PM-1536x783.png 1536w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/11\/Screen-Shot-2017-11-10-at-10.22.38-PM-20x10.png 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/11\/Screen-Shot-2017-11-10-at-10.22.38-PM-1320x673.png 1320w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/11\/Screen-Shot-2017-11-10-at-10.22.38-PM.png 1790w\" sizes=\"auto, (max-width: 735px) 100vw, 735px\" \/><\/p>\n<p><span style=\"font-weight: 800\">\uaddc\uce59 #11: \uc778\ub371\uc2a4 \ud0a4 \uc21c\uc11c \ubc0f \uc608\uce21 \uc720\ud615<\/span><\/p>\n<p><span style=\"font-weight: 400\">\ucffc\ub9ac \uc0ac\uc6a9\uc790\uac00 \uc778\ub371\uc2a4\uc758 \ucc98\uc74c N\uac1c\uc758 \uc5f0\uc18d\ub41c \ud0a4\uc5d0 \uc758\ud574 \uc0dd\uc131\ud55c \uc778\ub371\uc2a4 \uc2a4\uce94 \uc694\uccad\uc785\ub2c8\ub2e4.  \ub530\ub77c\uc11c \uc778\ub371\uc2a4 \ud0a4\uc758 \uc21c\uc11c\uac00 \uc911\uc694\ud569\ub2c8\ub2e4. <\/span><\/p>\n<p><span style=\"font-weight: 400\">\ub2e4\uc591\ud55c \uc220\uc5b4\uac00 \ud3ec\ud568\ub41c \ucffc\ub9ac\ub97c \uc0dd\uac01\ud574 \ubcf4\uc138\uc694:<\/span><\/p>\n<pre class=\"font-size:17 line-height:20 wrap:true lang:mysql decode:true\">SELECT cid, address FROM CUSTOMER\r\n  WHERE state = \u2018CA\u2019\r\n  AND type = \u2018premium\u2019\r\n  AND zipcode IN [29482, 29284, 29482, 28472]\r\n  AND salary &lt; 50000 AND age &gt; 45;<\/pre>\n<p><span style=\"font-weight: 400\">\uc774\uac83\uc740 \uc778\ub371\uc2a4\uc758 \ud0a4 \uc21c\uc11c\uc5d0 \ub300\ud55c \uc77c\ubc18\uc801\uc778 \uaddc\uce59\uc785\ub2c8\ub2e4.  \ud0a4\ub294 \ub354 \uac04\ub2e8\ud55c \uc2a4\uce7c\ub77c \uc18d\uc131\uc774\ub098 \uc2a4\uce7c\ub77c \uac12\uc744 \ubc18\ud658\ud558\ub294 \ud45c\ud604\uc2dd(\uc608: UPPER(name.lastname))\uc77c \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">\uc6b0\uc120 \uc21c\uc704\ub294 \ud3c9\ub4f1 \uc220\uc5b4\uac00 \uc788\ub294 \ud0a4\uc785\ub2c8\ub2e4. \uc774 \ucffc\ub9ac\uc5d0\uc11c\ub294 \uc0c1\ud0dc\uc640 \uc720\ud615\uc5d0 \ub300\ud55c \uac83\uc785\ub2c8\ub2e4. \uac19\uc740 \uc720\ud615\uc758 \uc220\uc5b4\uac00 \uc5ec\ub7ec \uac1c \uc788\ub294 \uacbd\uc6b0 \uc544\ubb34 \uc870\ud569\uc774\ub098 \uc120\ud0dd\ud569\ub2c8\ub2e4.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">\ub450 \ubc88\uc9f8 \uc6b0\uc120 \uc21c\uc704\ub294 IN \uc220\uc5b4\uac00 \uc788\ub294 \ud0a4\uc785\ub2c8\ub2e4. \uc774 \ucffc\ub9ac\uc5d0\uc11c\ub294 \uc6b0\ud3b8\ubc88\ud638\uc5d0 \uc788\uc2b5\ub2c8\ub2e4.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">\uc138 \ubc88\uc9f8 \uc6b0\uc120 \uc21c\uc704\ub294 (&lt;)\ubcf4\ub2e4 \uc791\uc740 \uc220\uc5b4\uc785\ub2c8\ub2e4. \uc774 \uacbd\uc6b0 \uae09\uc5ec\uc5d0 \ud574\ub2f9\ud569\ub2c8\ub2e4.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">\ub124 \ubc88\uc9f8 \uc6b0\uc120 \uc21c\uc704\ub294 \uc0ac\uc774 \uc220\uc5b4\uc785\ub2c8\ub2e4. \uc774 \ucffc\ub9ac\uc5d0\ub294 \uc0ac\uc774 \uc220\uc5b4\uac00 \uc5c6\uc2b5\ub2c8\ub2e4.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">\ub2e4\uc12f \ubc88\uc9f8 \uc6b0\uc120 \uc21c\uc704\ub294 \ubcf4\ub2e4 \ud070(&gt;) \uc220\uc5b4\uc785\ub2c8\ub2e4.  \uc774 \ucffc\ub9ac\uc5d0\uc11c\ub294 \ub098\uc774\uc5d0 \ub300\ud55c \uac83\uc785\ub2c8\ub2e4.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">\uc5ec\uc12f \ubc88\uc9f8 \uc6b0\uc120 \uc21c\uc704\ub294 \ubc30\uc5f4 \uc220\uc5b4\uc785\ub2c8\ub2e4: UNNEST \ub4a4\uc5d0 \uc624\ub294 \uc220\uc5b4\uc778 ANY \ub610\ub294 EVERY AND ANY\uc785\ub2c8\ub2e4.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">\ucffc\ub9ac\ub97c \ud3ec\ud568\ud560 \uc218 \uc788\ub3c4\ub85d \uc778\ub371\uc2a4\uc5d0 \ud544\ub4dc\ub97c \ucd94\uac00\ud558\uc138\uc694.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">\uc774 \ubd84\uc11d\uc744 \uc218\ud589\ud55c \ud6c4 WHERE \uc808\ub85c \uc774\ub3d9\ud560 \uc218 \uc788\ub294 \ud45c\ud604\uc2dd\uc744 \ucc3e\uc2b5\ub2c8\ub2e4.  \uc608\ub97c \ub4e4\uc5b4, \uc774 \uacbd\uc6b0 type = \"premium\"\uc740 \uc0ac\uc6a9\uc790\uac00 \uace0\uac1d \uc720\ud615\uc744 \uc2dd\ubcc4\ud558\uae30 \uc704\ud574 type \ud544\ub4dc\ub97c \uc9c0\uc815\ud558\ubbc0\ub85c \uc774\ub3d9\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400\">\uc774\ub97c \ud1b5\ud574 \ub2e4\uc74c\uacfc \uac19\uc740 \uc778\ub371\uc2a4\uac00 \ub9cc\ub4e4\uc5b4\uc9d1\ub2c8\ub2e4.<\/span><\/p>\n<pre class=\"font-size:17 line-height:20 lang:mysql decode:true\">CREATE INDEX idx_order \r\n  ON CUSTOMER ( \r\n    state, zipcode, salary, age, address, cid\r\n  ) \r\n  WHERE type = \"premium\";<\/pre>\n<p><span style=\"font-weight: 800\">\uaddc\uce59 #12: \uc124\uba85 \ubc0f \ud504\ub85c\ud544\uc744 \uc77d\ub294 \ubc29\ubc95 \uc774\ud574\ud558\uae30<\/span><\/p>\n<p><span style=\"font-weight: 400\">\uc544\ubb34\ub9ac \ub9ce\uc740 \uaddc\uce59\uc744 \ub530\ub974\ub354\ub77c\ub3c4 \ucffc\ub9ac \uacc4\ud68d\uacfc \ud504\ub85c\ud30c\uc77c\ub9c1\uc744 \uc774\ud574\ud558\uace0, \ubd80\ud558\uac00 \uac78\ub9b0 \uc2dc\uc2a4\ud15c\uc744 \ubaa8\ub2c8\ud130\ub9c1\ud558\uace0, \uc774\ub97c \uc870\uc815\ud574\uc57c \ud569\ub2c8\ub2e4.  \ucffc\ub9ac \uacc4\ud68d\uacfc \ud504\ub85c\ud30c\uc77c\ub9c1 \uc815\ubcf4\ub97c \uc774\ud574\ud558\uace0 \ubd84\uc11d\ud558\ub294 \ub2a5\ub825\uc740 \ucffc\ub9ac\uc640 \uc6cc\ud06c\ub85c\ub4dc\ub97c \ud29c\ub2dd\ud558\ub294 \ub370 \uc788\uc5b4 \ud575\uc2ec\uc785\ub2c8\ub2e4.  \uc774\ub7ec\ud55c \uc8fc\uc81c\uc5d0 \ub300\ud55c \ub450 \uac1c\uc758 \ud6cc\ub96d\ud55c \ubb38\uc11c\uac00 \uc788\uc2b5\ub2c8\ub2e4.  \uc608\uc81c\ub97c \uc0b4\ud3b4\ubcf4\uace0 \uc0ac\uc6a9\ud574 \ubcf4\uc138\uc694.\u00a0<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400\"><a href=\"https:\/\/dzone.com\/articles\/understanding-index-scans-in-couchbase-50-n1ql-que\"><span style=\"font-weight: 400\">https:\/\/dzone.com\/articles\/understanding-index-scans-in-couchbase-50-n1ql-que<\/span><\/a><\/li>\n<li style=\"font-weight: 400\"><a href=\"https:\/\/www.couchbase.com\/blog\/ko\/profiling-monitoring-update-2\/\"><span style=\"font-weight: 400\">https:\/\/www.couchbase.com\/blog\/profiling-monitoring-update-2\/<\/span><\/a><\/li>\n<\/ul>\n<p><b>\ucc38\uc870<\/b><\/p>\n<ul>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">Nitro: NoSQL \uae00\ub85c\ubc8c \ubcf4\uc870 \uc778\ub371\uc2a4\ub97c \uc704\ud55c \ube60\ub974\uace0 \ud655\uc7a5 \uac00\ub2a5\ud55c \uc778\uba54\ubaa8\ub9ac \uc2a4\ud1a0\ub9ac\uc9c0 \uc5d4\uc9c4:<\/span><a href=\"https:\/\/vldb2016.persistent.com\/industrial_track_papers.php\"> <span style=\"font-weight: 400\">https:\/\/vldb2016.persistent.com\/industrial_track_papers.php<\/span><\/a><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">\uce74\uc6b0\uce58\ubca0\uc774\uc2a4: \u00a0<\/span><a href=\"https:\/\/www.couchbase.com\/blog\/ko\/\"><span style=\"font-weight: 400\">https:\/\/www.couchbase.com<\/span><\/a><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">\uce74\uc6b0\uce58\ubca0\uc774\uc2a4 \ubb38\uc11c:<\/span> <a href=\"https:\/\/docs.couchbase.com\"><span style=\"font-weight: 400\">https:\/\/docs.couchbase.com<\/span><\/a><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">N1QL: \uc2e4\ubb34 \uac00\uc774\ub4dc: <\/span><a href=\"https:\/\/www.couchbase.com\/blog\/ko\/n1ql-practical-guide-second-edition\/\"><span style=\"font-weight: 400\">https:\/\/www.couchbase.com\/blog\/n1ql-practical-guide-second-edition\/<\/span><\/a><\/li>\n<li>\uc778\ub371\uc2a4 \uc5b4\ub4dc\ubc14\uc774\uc800: \uc778\ub371\uc2a4 \uc0dd\uc131 \uaddc\uce59:\u00a0<a href=\"https:\/\/www.slideshare.net\/journalofinformix\/couchbase-n1ql-index-advisor\">https:\/\/www.slideshare.net\/journalofinformix\/couchbase-n1ql-index-advisor<\/a><\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>Introduction There are three things important in database systems: performance, performance, performance. For NoSQL database systems, there are three important things: performance at scale, performance at scale, performance at scale. Understanding the index options, creating the right index, with the [&hellip;]<\/p>","protected":false},"author":55,"featured_media":4218,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[1814,9417,1812],"tags":[1311,1505,1725,1854,2093,1506],"ppma_author":[8929],"class_list":["post-4204","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-application-design","category-performance","category-n1ql-query","tag-architecture","tag-index","tag-nosql-database","tag-profiling","tag-scale","tag-tuning"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.0 (Yoast SEO v26.0) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Right Index Option: How to Get the Right Performance<\/title>\n<meta name=\"description\" content=\"Understanding the index options, creating the right index, with the right keys, right order, and right expression is critical to query performance at scale.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.couchbase.com\/blog\/ko\/create-right-index-get-right-performance\/\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Create the Right Index, Get the Right Performance.\" \/>\n<meta property=\"og:description\" content=\"Understanding the index options, creating the right index, with the right keys, right order, and right expression is critical to query performance at scale.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/ko\/create-right-index-get-right-performance\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:published_time\" content=\"2017-11-12T22:08:59+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-14T03:20:14+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/11\/Screen-Shot-2017-11-12-at-10.48.03-PM.png\" \/>\n\t<meta property=\"og:image:width\" content=\"854\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Keshav Murthy\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@rkeshavmurthy\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Keshav Murthy\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"20\ubd84\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/create-right-index-get-right-performance\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/create-right-index-get-right-performance\/\"},\"author\":{\"name\":\"Keshav Murthy\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/c261644262bf98e146372fe647682636\"},\"headline\":\"Create the Right Index, Get the Right Performance.\",\"datePublished\":\"2017-11-12T22:08:59+00:00\",\"dateModified\":\"2025-06-14T03:20:14+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/create-right-index-get-right-performance\/\"},\"wordCount\":4279,\"commentCount\":5,\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/create-right-index-get-right-performance\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/11\/Screen-Shot-2017-11-12-at-10.48.03-PM.png\",\"keywords\":[\"Architecture\",\"Index\",\"NoSQL Database\",\"profiling\",\"scale\",\"Tuning\"],\"articleSection\":[\"Application Design\",\"High Performance\",\"SQL++ \/ N1QL Query\"],\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/create-right-index-get-right-performance\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/create-right-index-get-right-performance\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/create-right-index-get-right-performance\/\",\"name\":\"Right Index Option: How to Get the Right Performance\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/create-right-index-get-right-performance\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/create-right-index-get-right-performance\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/11\/Screen-Shot-2017-11-12-at-10.48.03-PM.png\",\"datePublished\":\"2017-11-12T22:08:59+00:00\",\"dateModified\":\"2025-06-14T03:20:14+00:00\",\"description\":\"Understanding the index options, creating the right index, with the right keys, right order, and right expression is critical to query performance at scale.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/create-right-index-get-right-performance\/#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/create-right-index-get-right-performance\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/create-right-index-get-right-performance\/#primaryimage\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/11\/Screen-Shot-2017-11-12-at-10.48.03-PM.png\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/11\/Screen-Shot-2017-11-12-at-10.48.03-PM.png\",\"width\":854,\"height\":628},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/create-right-index-get-right-performance\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.couchbase.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Create the Right Index, Get the Right Performance.\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\",\"url\":\"https:\/\/www.couchbase.com\/blog\/\",\"name\":\"The Couchbase Blog\",\"description\":\"Couchbase, the NoSQL Database\",\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.couchbase.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ko-KR\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\",\"name\":\"The Couchbase Blog\",\"url\":\"https:\/\/www.couchbase.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png\",\"width\":218,\"height\":34,\"caption\":\"The Couchbase Blog\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/c261644262bf98e146372fe647682636\",\"name\":\"Keshav Murthy\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/4e51d72fc07c662aa791316deafffac4\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/af74df754db27152971d0aed2f323ead5a1f9fe5afd0209af91e12e784451224?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/af74df754db27152971d0aed2f323ead5a1f9fe5afd0209af91e12e784451224?s=96&d=mm&r=g\",\"caption\":\"Keshav Murthy\"},\"description\":\"Keshav Murthy is a Vice President at Couchbase R&amp;D. Previously, he was at MapR, IBM, Informix, Sybase, with more than 20 years of experience in database design &amp; development. He lead the SQL and NoSQL R&amp;D team at IBM Informix. He has received two President's Club awards at Couchbase, two Outstanding Technical Achievement Awards at IBM. Keshav has a bachelor's degree in Computer Science and Engineering from the University of Mysore, India, holds eleven US patents and has four US patents pending.\",\"sameAs\":[\"https:\/\/blog.planetnosql.com\/\",\"https:\/\/x.com\/rkeshavmurthy\"],\"url\":\"https:\/\/www.couchbase.com\/blog\/ko\/author\/keshav-murthy\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Right Index Option: How to Get the Right Performance","description":"\uc778\ub371\uc2a4 \uc635\uc158\uc744 \uc774\ud574\ud558\uace0, \uc62c\ubc14\ub978 \ud0a4, \uc62c\ubc14\ub978 \uc21c\uc11c, \uc62c\ubc14\ub978 \ud45c\ud604\uc2dd\uc744 \uc0ac\uc6a9\ud558\uc5ec \uc62c\ubc14\ub978 \uc778\ub371\uc2a4\ub97c \uc0dd\uc131\ud558\ub294 \uac83\uc740 \ub300\uaddc\ubaa8 \ucffc\ub9ac \uc131\ub2a5\uc744 \uc704\ud574 \ub9e4\uc6b0 \uc911\uc694\ud569\ub2c8\ub2e4.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.couchbase.com\/blog\/ko\/create-right-index-get-right-performance\/","og_locale":"ko_KR","og_type":"article","og_title":"Create the Right Index, Get the Right Performance.","og_description":"Understanding the index options, creating the right index, with the right keys, right order, and right expression is critical to query performance at scale.","og_url":"https:\/\/www.couchbase.com\/blog\/ko\/create-right-index-get-right-performance\/","og_site_name":"The Couchbase Blog","article_published_time":"2017-11-12T22:08:59+00:00","article_modified_time":"2025-06-14T03:20:14+00:00","og_image":[{"width":854,"height":628,"url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/11\/Screen-Shot-2017-11-12-at-10.48.03-PM.png","type":"image\/png"}],"author":"Keshav Murthy","twitter_card":"summary_large_image","twitter_creator":"@rkeshavmurthy","twitter_misc":{"Written by":"Keshav Murthy","Est. reading time":"20\ubd84"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/create-right-index-get-right-performance\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/create-right-index-get-right-performance\/"},"author":{"name":"Keshav Murthy","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/c261644262bf98e146372fe647682636"},"headline":"Create the Right Index, Get the Right Performance.","datePublished":"2017-11-12T22:08:59+00:00","dateModified":"2025-06-14T03:20:14+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/create-right-index-get-right-performance\/"},"wordCount":4279,"commentCount":5,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/create-right-index-get-right-performance\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/11\/Screen-Shot-2017-11-12-at-10.48.03-PM.png","keywords":["Architecture","Index","NoSQL Database","profiling","scale","Tuning"],"articleSection":["Application Design","High Performance","SQL++ \/ N1QL Query"],"inLanguage":"ko-KR","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/create-right-index-get-right-performance\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/create-right-index-get-right-performance\/","url":"https:\/\/www.couchbase.com\/blog\/create-right-index-get-right-performance\/","name":"Right Index Option: How to Get the Right Performance","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/create-right-index-get-right-performance\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/create-right-index-get-right-performance\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/11\/Screen-Shot-2017-11-12-at-10.48.03-PM.png","datePublished":"2017-11-12T22:08:59+00:00","dateModified":"2025-06-14T03:20:14+00:00","description":"\uc778\ub371\uc2a4 \uc635\uc158\uc744 \uc774\ud574\ud558\uace0, \uc62c\ubc14\ub978 \ud0a4, \uc62c\ubc14\ub978 \uc21c\uc11c, \uc62c\ubc14\ub978 \ud45c\ud604\uc2dd\uc744 \uc0ac\uc6a9\ud558\uc5ec \uc62c\ubc14\ub978 \uc778\ub371\uc2a4\ub97c \uc0dd\uc131\ud558\ub294 \uac83\uc740 \ub300\uaddc\ubaa8 \ucffc\ub9ac \uc131\ub2a5\uc744 \uc704\ud574 \ub9e4\uc6b0 \uc911\uc694\ud569\ub2c8\ub2e4.","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/create-right-index-get-right-performance\/#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/create-right-index-get-right-performance\/"]}]},{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/www.couchbase.com\/blog\/create-right-index-get-right-performance\/#primaryimage","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/11\/Screen-Shot-2017-11-12-at-10.48.03-PM.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2017\/11\/Screen-Shot-2017-11-12-at-10.48.03-PM.png","width":854,"height":628},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/blog\/create-right-index-get-right-performance\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Create the Right Index, Get the Right Performance."}]},{"@type":"WebSite","@id":"https:\/\/www.couchbase.com\/blog\/#website","url":"https:\/\/www.couchbase.com\/blog\/","name":"\uce74\uc6b0\uce58\ubca0\uc774\uc2a4 \ube14\ub85c\uadf8","description":"NoSQL \ub370\uc774\ud130\ubca0\uc774\uc2a4, Couchbase","publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.couchbase.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ko-KR"},{"@type":"Organization","@id":"https:\/\/www.couchbase.com\/blog\/#organization","name":"\uce74\uc6b0\uce58\ubca0\uc774\uc2a4 \ube14\ub85c\uadf8","url":"https:\/\/www.couchbase.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png","width":218,"height":34,"caption":"The Couchbase Blog"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/c261644262bf98e146372fe647682636","name":"\ucf00\uc0e4\ube0c \uba38\uc2dc","image":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/4e51d72fc07c662aa791316deafffac4","url":"https:\/\/secure.gravatar.com\/avatar\/af74df754db27152971d0aed2f323ead5a1f9fe5afd0209af91e12e784451224?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/af74df754db27152971d0aed2f323ead5a1f9fe5afd0209af91e12e784451224?s=96&d=mm&r=g","caption":"Keshav Murthy"},"description":"\ucf00\uc0e4\ube0c \uba38\uc2dc\ub294 Couchbase R&amp;D\uc758 \ubd80\uc0ac\uc7a5\uc785\ub2c8\ub2e4. \uc774\uc804\uc5d0\ub294 MapR, IBM, Informix, Sybase\uc5d0\uc11c \uadfc\ubb34\ud588\uc73c\uba70 \ub370\uc774\ud130\ubca0\uc774\uc2a4 \uc124\uacc4 \ubc0f \uac1c\ubc1c \ubd84\uc57c\uc5d0\uc11c 20\ub144 \uc774\uc0c1\uc758 \uacbd\ub825\uc744 \uc313\uc558\uc2b5\ub2c8\ub2e4. IBM Informix\uc5d0\uc11c SQL \ubc0f NoSQL R&amp;D \ud300\uc744 \uc774\ub04c\uc5c8\uc2b5\ub2c8\ub2e4. Couchbase\uc5d0\uc11c \ub450 \ucc28\ub840\uc758 President's Club \uc0c1\uc744, IBM\uc5d0\uc11c \ub450 \ucc28\ub840\uc758 Outstanding Technical Achievement Award\ub97c \uc218\uc0c1\ud588\uc2b5\ub2c8\ub2e4. \uc778\ub3c4 \ub9c8\uc774\uc18c\ub974 \ub300\ud559\uad50\uc5d0\uc11c \ucef4\ud4e8\ud130 \uacfc\ud559 \ubc0f \uacf5\ud559 \ud559\uc0ac \ud559\uc704\ub97c \ubc1b\uc558\uc73c\uba70, 11\uac1c\uc758 \ubbf8\uad6d \ud2b9\ud5c8\ub97c \ubcf4\uc720\ud558\uace0 \uc788\uace0 4\uac1c\uc758 \ubbf8\uad6d \ud2b9\ud5c8\ub97c \ucd9c\uc6d0 \uc911\uc785\ub2c8\ub2e4.","sameAs":["https:\/\/blog.planetnosql.com\/","https:\/\/x.com\/rkeshavmurthy"],"url":"https:\/\/www.couchbase.com\/blog\/ko\/author\/keshav-murthy\/"}]}},"authors":[{"term_id":8929,"user_id":55,"is_guest":0,"slug":"keshav-murthy","display_name":"Keshav Murthy","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/af74df754db27152971d0aed2f323ead5a1f9fe5afd0209af91e12e784451224?s=96&d=mm&r=g","author_category":"","last_name":"Murthy","first_name":"Keshav","job_title":"","user_url":"https:\/\/blog.planetnosql.com\/","description":"\ucf00\uc0e4\ube0c \uba38\uc2dc\ub294 Couchbase R&amp;D\uc758 \ubd80\uc0ac\uc7a5\uc785\ub2c8\ub2e4. \uc774\uc804\uc5d0\ub294 MapR, IBM, Informix, Sybase\uc5d0\uc11c \uadfc\ubb34\ud588\uc73c\uba70 \ub370\uc774\ud130\ubca0\uc774\uc2a4 \uc124\uacc4 \ubc0f \uac1c\ubc1c \ubd84\uc57c\uc5d0\uc11c 20\ub144 \uc774\uc0c1\uc758 \uacbd\ub825\uc744 \uc313\uc558\uc2b5\ub2c8\ub2e4. IBM Informix\uc5d0\uc11c SQL \ubc0f NoSQL R&amp;D \ud300\uc744 \uc774\ub04c\uc5c8\uc2b5\ub2c8\ub2e4. Couchbase\uc5d0\uc11c \ub450 \ubc88\uc758 President's Club \uc0c1\uc744, IBM\uc5d0\uc11c \ub450 \ubc88\uc758 \uc6b0\uc218 \uae30\uc220 \uc5c5\uc801\uc0c1\uc744 \uc218\uc0c1\ud588\uc2b5\ub2c8\ub2e4. \uc778\ub3c4 \ub9c8\uc774\uc18c\ub974 \ub300\ud559\uad50\uc5d0\uc11c \ucef4\ud4e8\ud130 \uacfc\ud559 \ubc0f \uacf5\ud559 \ud559\uc0ac \ud559\uc704\ub97c \ubc1b\uc558\uc73c\uba70, 10\uac1c\uc758 \ubbf8\uad6d \ud2b9\ud5c8\ub97c \ubcf4\uc720\ud558\uace0 \uc788\uace0 3\uac1c\uc758 \ubbf8\uad6d \ud2b9\ud5c8\ub97c \ucd9c\uc6d0 \uc911\uc785\ub2c8\ub2e4."}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/posts\/4204","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/users\/55"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/comments?post=4204"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/posts\/4204\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/media\/4218"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/media?parent=4204"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/categories?post=4204"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/tags?post=4204"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/ppma_author?post=4204"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}