{"id":7940,"date":"2019-12-26T10:54:55","date_gmt":"2019-12-26T18:54:55","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/?p=7940"},"modified":"2025-06-13T17:21:52","modified_gmt":"2025-06-14T00:21:52","slug":"index-advisor-service","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/index-advisor-service\/","title":{"rendered":"Index Advisor Service for Couchbase N1QL(SQL for JSON)"},"content":{"rendered":"<p><span style=\"color: #000000\">We are excited to announce the release of :<\/span><\/p>\n<h3><span style=\"color: #993300\"> Couchbase Index Advisor Service<\/span><\/h3>\n<h3><a href=\"https:\/\/index-advisor.couchbase.com\">https:\/\/index-advisor.couchbase.com<\/a><\/h3>\n<h4>Yet Another service? Why?<\/h4>\n<p>We released N1QL(SQL for JSON) a few years ago- so that you could use SQL to retrieve and manipulate JSON data. But then unless good indexes are created- the queries don&#8217;t perform as well! How would you know if the index you created is a good enough index for our query engine? So, we decided to put out all the rules that make a good index. But that involved too much reading! So we are going one step further to empower you. We are now releasing a service &#8211;<strong>Index Advisor<\/strong>-that accepts a query and gives out an index recommendation that would meet the expectations of our query engine-all without downloading the latest Couchbase server.<\/p>\n<h4>For Who?<\/h4>\n<p>This service will provide index recommendations to help DBAs, developers, and architects optimize query performance and meet the SLAs.<\/p>\n<p>Index Advisor is released as part of Couchbase Server 6.5. If you have downloaded that version, then you have everything (and more) than what this service provides.<\/p>\n<h4>When should you use this service?<\/h4>\n<p>If you:<\/p>\n<ol>\n<li>Want to avoid reading the <a href=\"https:\/\/docs.couchbase.com\/server\/current\/n1ql\/n1ql-language-reference\/createindex.html\">index creation<\/a> <a href=\"https:\/\/www.couchbase.com\/blog\/create-right-index-get-right-performance\/\">rules<\/a>, understand them, and implement them to find the appropriate indexes for your query\/queries\/workload.<\/li>\n<li>\u00a0Do not want to download the latest Couchbase 6.5 server yet.<\/li>\n<li>\u00a0Are using an <strong>older Couchbase version<\/strong> and need help creating the right indexes for your queries.<\/li>\n<li>Want to generate advice for indexes <strong>without creating a bucket<\/strong> or uploading the schema or data.<\/li>\n<\/ol>\n<h4>Background:<\/h4>\n<p>N1QL is the SQL\u00a0 for JSON data and metadata. Every query written in N1QL has a query plan prepared by the N1QL query engine. The performance and efficiency of a query depend on its plan. Creation of right indexes for the data helps in selection of those indexes which can retrieve the result set in the most efficient manner. Even though JSON document itself has no schema, the index needs to have a schema.<\/p>\n<p>For e.g index <span style=\"color: #3366ff\">ix1(field1,field2)<\/span> is different from index <span style=\"color: #993366\">ix2(field2,field1)<\/span>.<\/p>\n<p>So not only the fields we select for an index are important, the order in which they are present in an index is also important for GSI indexes. (FTS index -we shall cover in another blog.)<\/p>\n<h4>Life of a Query:<\/h4>\n<p><img decoding=\"async\" src=\"https:\/\/lh4.googleusercontent.com\/bUAH1tBFCqxjrnWB-JOpJ-hCLUSJ4ispcUe2QQDvSJhxv_JQO4oGrPAIijxCtTnvr2gjijbFprOefbDDXBmv7X4zUB2-gswgByTlbq9UQKYZCAjToxUtWKjyR1aSpVVjnVbXXDi7\" alt=\"Screen Shot 2016-12-12 at 2.10.40 PM.png\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>Depending on how good step 4 is- we can minimize\/completely skip steps 5 and 6 and thereby improve the performance of the query.So deciding fields in an index is a very important part. To help with this we are releasing Index Advisor.<\/p>\n<p><a href=\"https:\/\/index-advisor.couchbase.com\">https:\/\/index-advisor.couchbase.com<\/a><\/p>\n<h4>Index Advisor &#8211; the service!<\/h4>\n<p>With Index Advisor, you can<\/p>\n<ol>\n<li>Provide a query or multiple queries from <strong>even a server older than 6.5<\/strong> and the service will recommend the indexes you should have\/create to get the best performance.<\/li>\n<li>Since we do not have your data or schema, we are not able to see if you currently have those indexes. We will soon be improving this interface to accept data\/statistics\/schema\/infer op\/current indexes &#8211; or whatever else you can provide for us to make better recommendations.<\/li>\n<\/ol>\n<p>Once you give us the query with ADVISE directive, the tool will give the recommendations for minimal index and covering index.<\/p>\n<ul>\n<li>Indexes: This section lists the recommended indexes based on predicates in WHERE\/ON clause, along with the corresponding recommendation rule that each index follows.<\/li>\n<li>Covering Indexes: This section lists the covering indexes applicable to the input query i.e. an index that includes all fields referenced in the query to avoid the extra hop to data service.<\/li>\n<\/ul>\n<p>Here is the look and feel of the tool. Click on the gif below to see it clearly.<\/p>\n<p><a href=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2019\/12\/IndexAdvisorexample.gif\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-7963\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2019\/12\/IndexAdvisorexample-300x158.gif\" alt=\"\" width=\"1115\" height=\"587\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/12\/IndexAdvisorexample-300x158.gif 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/12\/IndexAdvisorexample-1024x540.gif 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/12\/IndexAdvisorexample-768x405.gif 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/12\/IndexAdvisorexample-1536x810.gif 1536w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/12\/IndexAdvisorexample-20x11.gif 20w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/12\/IndexAdvisorexample-1320x696.gif 1320w\" sizes=\"auto, (max-width: 1115px) 100vw, 1115px\" \/><\/a><\/p>\n<p>Examples:<\/p>\n<p>1.<\/p>\n<pre class=\"lang:default decode:true\">ADVISE SELECT fname, age, age\/7 AS age_dog_years FROM trial WHERE fname = 'Sara'<\/pre>\n<pre class=\"lang:default decode:true\">{\r\n  \"results\": [\r\n    {\r\n      \"#operator\": \"Advise\",\r\n      \"advice\": {\r\n        \"#operator\": \"IndexAdvice\",\r\n        \"adviseinfo\": [\r\n          {\r\n            \"recommended_indexes\": {\r\n              \"covering_indexes\": [\r\n                {\r\n                  \"index_statement\": \"CREATE INDEX adv_fname_age ON `trial`(`fname`,`age`)\",\r\n                  \"keyspace_alias\": \"trial\"\r\n                }\r\n              ],\r\n              \"indexes\": [\r\n                {\r\n                  \"index_statement\": \"CREATE INDEX adv_fname ON `trial`(`fname`)\",\r\n                  \"keyspace_alias\": \"trial\",\r\n                  \"recommending_rule\": \"Index keys follow order of predicate types: 2. equality\/null\/missing.\"\r\n                }\r\n              ]\r\n            }\r\n          }\r\n        ]\r\n      },\r\n      \"query\": \"SELECT fname, age, age\/7 AS age_dog_years FROM trial WHERE fname = 'Sara'\"\r\n    }\r\n  ]\r\n}\r\n<\/pre>\n<p>2.<\/p>\n<pre class=\"lang:default decode:true\">ADVISE SELECT (DISTINCT purchases.customerId)FROM purchases\u00a0\r\nWHERE purchases.purchasedAt BETWEEN \"2014-03-01\" AND \"2014-03-31\"<\/pre>\n<pre class=\"lang:default decode:true \">{\r\n  \"results\": [\r\n    {\r\n      \"#operator\": \"Advise\",\r\n      \"advice\": {\r\n        \"#operator\": \"IndexAdvice\",\r\n        \"adviseinfo\": [\r\n          {\r\n            \"recommended_indexes\": {\r\n              \"indexes\": [\r\n                {\r\n                  \"index_statement\": \"CREATE INDEX adv_purchasedAt ON `purchases`(`purchasedAt`)\",\r\n                  \"keyspace_alias\": \"purchases\",\r\n                  \"recommending_rule\": \"Index keys follow order of predicate types: 4. not less than\/between\/not greater than.\"\r\n                }\r\n              ]\r\n            }\r\n          }\r\n        ]\r\n      },\r\n      \"query\": \"SELECT (DISTINCT purchases.customerId) \\nFROM purchases\\nWHERE purchases.purchasedAt BETWEEN \\\"2014-03-01\\\" AND \\\"2014-03-31\\\"\"\r\n    }\r\n  ]\r\n}<\/pre>\n<p>3.<\/p>\n<pre class=\"lang:default decode:true\">ADVISE SELECT DISTINCT airline.name,airport.name AS airport,route.distance \r\nFROM `travel-sample` airport INNER JOIN `travel-sample` route ON airport.faa = route.sourceairport\r\nAND route.type = \"route\" INNER JOIN `travel-sample` airline ON route.airline = airline.iata \r\nAND airline.type = \"airline\"<\/pre>\n<pre class=\"lang:default decode:true\">{\r\n  \"results\": [\r\n    {\r\n      \"#operator\": \"Advise\",\r\n      \"advice\": {\r\n        \"#operator\": \"IndexAdvice\",\r\n        \"adviseinfo\": [\r\n          {\r\n            \"recommended_indexes\": {\r\n              \"covering_indexes\": [\r\n                {\r\n                  \"index_statement\": \"CREATE INDEX adv_type_sourceairport_airline_distance ON `travel-sample`(`type`,`sourceairport`,`airline`,`distance`)\",\r\n                  \"keyspace_alias\": \"travel-sample_route\"\r\n                },\r\n                {\r\n                  \"index_statement\": \"CREATE INDEX adv_type_iata_name ON `travel-sample`(`type`,`iata`,`name`)\",\r\n                  \"keyspace_alias\": \"travel-sample_airline\"\r\n                }\r\n              ],\r\n              \"indexes\": [\r\n                {\r\n                  \"index_statement\": \"CREATE INDEX adv_type_sourceairport ON `travel-sample`(`type`,`sourceairport`)\",\r\n                  \"keyspace_alias\": \"travel-sample_route\",\r\n                  \"recommending_rule\": \"Index keys follow order of predicate types: 2. equality\/null\/missing, 10. non-static join predicate.\"\r\n                },\r\n                {\r\n                  \"index_statement\": \"CREATE INDEX adv_type_iata ON `travel-sample`(`type`,`iata`)\",\r\n                  \"keyspace_alias\": \"travel-sample_airline\",\r\n                  \"recommending_rule\": \"Index keys follow order of predicate types: 2. equality\/null\/missing, 10. non-static join predicate.\"\r\n                }\r\n              ]\r\n            }\r\n          }\r\n        ]\r\n      },\r\n      \"query\": \"SELECT DISTINCT airline.name,airport.name AS airport,route.distance FROM `travel-sample` airport INNER JOIN `travel-sample` route ON airport.faa = route.sourceairport AND route.type = \\\"route\\\"\\nINNER JOIN `travel-sample` airline ON route.airline = airline.iata AND airline.type = \\\"airline\\\"\\nWHERE airport.type = \\\"airport\\\" AND airport.city = \\\"San Jose\\\";\"\r\n    }\r\n  ]\r\n}<\/pre>\n<p>4.<\/p>\n<pre class=\"lang:default decode:true \">SELECT ADVISOR([\"SELECT * FROM `travel-sample` WHERE type = 'hotel' AND city = 'Paris'\", \r\n                \"SELECT * FROM `travel-sample` h JOIN `travel-sample` a ON a.city = h.city\r\n                                           WHERE h.type = 'hotel' AND a.type = 'airport'\"])<\/pre>\n<p>&nbsp;<\/p>\n<div class=\"listingblock\" data-ce-key=\"2760\">\n<div class=\"title\" data-ce-key=\"2761\">Result<\/div>\n<\/div>\n<pre class=\"lang:default decode:true\">{\r\n  \"results\": [\r\n    {\r\n      \"$1\": {\r\n        \"recommended_indexes\": [\r\n          {\r\n            \"index\": \"CREATE INDEX adv_type_city ON `travel-sample`(`type`,`city`)\",\r\n            \"statements\": [\r\n              {\r\n                \"run_count\": 1,\r\n                \"statement\": \"SELECT * FROM `travel-sample` WHERE type = 'hotel' AND city = 'Paris'\"\r\n              },\r\n              {\r\n                \"run_count\": 1,\r\n                \"statement\": \"SELECT * FROM `travel-sample` h JOIN `travel-sample` a ON a.city = h.city                                 WHERE h.type = 'hotel' AND a.type = 'airport'\"\r\n              }\r\n            ]\r\n          }\r\n        ]\r\n      }\r\n    }\r\n  ]\r\n}\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>The index candidates are generated following the design rules specified <a href=\"https:\/\/www.couchbase.com\/blog\/create-right-index-get-right-performance\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">here<\/a>.<\/p>\n<h4>What remains to be done:<\/h4>\n<p>1. Improve UI for this tool. Provide index recommendations in text for easier cut and paste. It currently provides a JSON output.<\/p>\n<p>2. Accept flavors- so we can generate partial index recommendations.<\/p>\n<p>3. Provide a way to let the user enter schema, existing indexes, infer output, maybe even test data.<\/p>\n<p>We would love to hear from you on how you liked the tool, any additional features you would like to see. Please share your feedback via the comments.<\/p>\n<h4>More about the Index Advisor feature:<\/h4>\n<p><a href=\"https:\/\/www.couchbase.com\/blog\/n1ql-index-advisor-improve-query-performance-and-productivity\/\">https:\/\/www.couchbase.com\/blog\/n1ql-index-advisor-improve-query-performance-and-productivity\/<\/a><\/p>\n<p><a href=\"https:\/\/www.couchbase.com\/blog\/index-advisor-for-query-workload\/\">https:\/\/www.couchbase.com\/blog\/index-advisor-for-query-workload\/<\/a><\/p>\n<p><a href=\"https:\/\/docs.couchbase.com\/server\/6.5\/n1ql\/n1ql-language-reference\/advise.html\">https:\/\/docs.couchbase.com\/server\/6.5\/n1ql\/n1ql-language-reference\/advise.html<\/a><\/p>\n<p><a href=\"https:\/\/docs.couchbase.com\/server\/6.5\/n1ql\/n1ql-language-reference\/advisor.html\">https:\/\/docs.couchbase.com\/server\/6.5\/n1ql\/n1ql-language-reference\/advisor.html<\/a><\/p>\n<p><a href=\"https:\/\/docs.couchbase.com\/server\/6.5\/tools\/query-workbench.html#index-advisor\">https:\/\/docs.couchbase.com\/server\/6.5\/tools\/query-workbench.html#index-advisor<\/a><\/p>\n<h4>Summary:<\/h4>\n<p>The index advisor (ADVISE statement) provides index recommendations for a single query. It advises regular index,\u00a0 array index, and covering index and provides information on the corresponding recommendation rule that each index key follows.<\/p>\n<p>The index advisor (ADVISOR statement) provides index recommendations for multiple queries. It recommends as few indexes as possible that would be suitable for all the queries in the array.<\/p>\n<p><strong>Do try this at\u00a0home!<\/strong><\/p>\n<p>https:\/\/index-advisor.couchbase.com<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We are excited to announce the release of : Couchbase Index Advisor Service https:\/\/index-advisor.couchbase.com Yet Another service? Why? We released N1QL(SQL for JSON) a few years ago- so that you could use SQL to retrieve and manipulate JSON data. But [&hellip;]<\/p>\n","protected":false},"author":50908,"featured_media":7971,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[1812],"tags":[2439,2440,2445,2444],"ppma_author":[9099],"class_list":["post-7940","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-n1ql-query","tag-index-advisor","tag-indexes","tag-query-optimization","tag-secondary-indexes"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.8 (Yoast SEO v25.8) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Index Advisor Service for Couchbase N1QL(SQL for JSON) - The Couchbase Blog<\/title>\n<meta name=\"description\" content=\"Couchbase Index advisor provides secondary index recommendations for SQL-like queries on JSON documents to improve query performance.\" \/>\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\/index-advisor-service\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Index Advisor Service for Couchbase N1QL(SQL for JSON)\" \/>\n<meta property=\"og:description\" content=\"Couchbase Index advisor provides secondary index recommendations for SQL-like queries on JSON documents to improve query performance.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/index-advisor-service\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:published_time\" content=\"2019-12-26T18:54:55+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-14T00:21:52+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/12\/ZgEfnw1X_400x400.png\" \/>\n\t<meta property=\"og:image:width\" content=\"400\" \/>\n\t<meta property=\"og:image:height\" content=\"400\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Kamini Jagtiani\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Kamini Jagtiani\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/index-advisor-service\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/index-advisor-service\/\"},\"author\":{\"name\":\"Kamini Jagtiani\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/f99c5767a877147f9cf658230bc2473b\"},\"headline\":\"Index Advisor Service for Couchbase N1QL(SQL for JSON)\",\"datePublished\":\"2019-12-26T18:54:55+00:00\",\"dateModified\":\"2025-06-14T00:21:52+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/index-advisor-service\/\"},\"wordCount\":847,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/index-advisor-service\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/12\/ZgEfnw1X_400x400.png\",\"keywords\":[\"Index Advisor\",\"Indexes\",\"Query optimization\",\"Secondary indexes\"],\"articleSection\":[\"SQL++ \/ N1QL Query\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/index-advisor-service\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/index-advisor-service\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/index-advisor-service\/\",\"name\":\"Index Advisor Service for Couchbase N1QL(SQL for JSON) - The Couchbase Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/index-advisor-service\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/index-advisor-service\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/12\/ZgEfnw1X_400x400.png\",\"datePublished\":\"2019-12-26T18:54:55+00:00\",\"dateModified\":\"2025-06-14T00:21:52+00:00\",\"description\":\"Couchbase Index advisor provides secondary index recommendations for SQL-like queries on JSON documents to improve query performance.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/index-advisor-service\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/index-advisor-service\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/index-advisor-service\/#primaryimage\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/12\/ZgEfnw1X_400x400.png\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/12\/ZgEfnw1X_400x400.png\",\"width\":400,\"height\":400},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/index-advisor-service\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.couchbase.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Index Advisor Service for Couchbase N1QL(SQL for JSON)\"}]},{\"@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\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\",\"name\":\"The Couchbase Blog\",\"url\":\"https:\/\/www.couchbase.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@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\/f99c5767a877147f9cf658230bc2473b\",\"name\":\"Kamini Jagtiani\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/257695296726c224fc7f0e85b30c9129\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/546f9f69203064f77430f14922d59be33e3f0ea674078a793fc813dd40310c5c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/546f9f69203064f77430f14922d59be33e3f0ea674078a793fc813dd40310c5c?s=96&d=mm&r=g\",\"caption\":\"Kamini Jagtiani\"},\"description\":\"Kamini Jagtiani is a Senior Engineering Manager for the Query Team at Couchbase R&amp;D. Before Couchbase, Kamini was 7 years at Futurewei as Kernel Architect\/Manager and 13 years at IBM Informix as Software Engineer. Kamini has a Bachelors's degree in Computer Science and Engineering from Bombay University, India and holds 5 US patents.\",\"url\":\"https:\/\/www.couchbase.com\/blog\/author\/kaminijagtiani\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Index Advisor Service for Couchbase N1QL(SQL for JSON) - The Couchbase Blog","description":"Couchbase Index advisor provides secondary index recommendations for SQL-like queries on JSON documents to improve query performance.","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\/index-advisor-service\/","og_locale":"en_US","og_type":"article","og_title":"Index Advisor Service for Couchbase N1QL(SQL for JSON)","og_description":"Couchbase Index advisor provides secondary index recommendations for SQL-like queries on JSON documents to improve query performance.","og_url":"https:\/\/www.couchbase.com\/blog\/index-advisor-service\/","og_site_name":"The Couchbase Blog","article_published_time":"2019-12-26T18:54:55+00:00","article_modified_time":"2025-06-14T00:21:52+00:00","og_image":[{"width":400,"height":400,"url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/12\/ZgEfnw1X_400x400.png","type":"image\/png"}],"author":"Kamini Jagtiani","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Kamini Jagtiani","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/index-advisor-service\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/index-advisor-service\/"},"author":{"name":"Kamini Jagtiani","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/f99c5767a877147f9cf658230bc2473b"},"headline":"Index Advisor Service for Couchbase N1QL(SQL for JSON)","datePublished":"2019-12-26T18:54:55+00:00","dateModified":"2025-06-14T00:21:52+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/index-advisor-service\/"},"wordCount":847,"commentCount":0,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/index-advisor-service\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/12\/ZgEfnw1X_400x400.png","keywords":["Index Advisor","Indexes","Query optimization","Secondary indexes"],"articleSection":["SQL++ \/ N1QL Query"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/index-advisor-service\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/index-advisor-service\/","url":"https:\/\/www.couchbase.com\/blog\/index-advisor-service\/","name":"Index Advisor Service for Couchbase N1QL(SQL for JSON) - The Couchbase Blog","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/index-advisor-service\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/index-advisor-service\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/12\/ZgEfnw1X_400x400.png","datePublished":"2019-12-26T18:54:55+00:00","dateModified":"2025-06-14T00:21:52+00:00","description":"Couchbase Index advisor provides secondary index recommendations for SQL-like queries on JSON documents to improve query performance.","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/index-advisor-service\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/index-advisor-service\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/index-advisor-service\/#primaryimage","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/12\/ZgEfnw1X_400x400.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2019\/12\/ZgEfnw1X_400x400.png","width":400,"height":400},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/blog\/index-advisor-service\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Index Advisor Service for Couchbase N1QL(SQL for JSON)"}]},{"@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":"en-US"},{"@type":"Organization","@id":"https:\/\/www.couchbase.com\/blog\/#organization","name":"The Couchbase Blog","url":"https:\/\/www.couchbase.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@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\/f99c5767a877147f9cf658230bc2473b","name":"Kamini Jagtiani","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/257695296726c224fc7f0e85b30c9129","url":"https:\/\/secure.gravatar.com\/avatar\/546f9f69203064f77430f14922d59be33e3f0ea674078a793fc813dd40310c5c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/546f9f69203064f77430f14922d59be33e3f0ea674078a793fc813dd40310c5c?s=96&d=mm&r=g","caption":"Kamini Jagtiani"},"description":"Kamini Jagtiani is a Senior Engineering Manager for the Query Team at Couchbase R&amp;D. Before Couchbase, Kamini was 7 years at Futurewei as Kernel Architect\/Manager and 13 years at IBM Informix as Software Engineer. Kamini has a Bachelors's degree in Computer Science and Engineering from Bombay University, India and holds 5 US patents.","url":"https:\/\/www.couchbase.com\/blog\/author\/kaminijagtiani\/"}]}},"authors":[{"term_id":9099,"user_id":50908,"is_guest":0,"slug":"kaminijagtiani","display_name":"Kamini Jagtiani","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/546f9f69203064f77430f14922d59be33e3f0ea674078a793fc813dd40310c5c?s=96&d=mm&r=g","author_category":"","last_name":"Jagtiani","first_name":"Kamini","job_title":"","user_url":"","description":"Kamini Jagtiani is a Senior Engineering Manager for the Query Team at Couchbase R&amp;D. Before Couchbase, Kamini was 7 years at Futurewei as Kernel Architect\/Manager and 13 years at IBM Informix as Software Engineer. Kamini has a Bachelors's degree in Computer Science and Engineering from Bombay University, India and holds 5 US patents."}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/7940","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/users\/50908"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/comments?post=7940"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/7940\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/media\/7971"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/media?parent=7940"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/categories?post=7940"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/tags?post=7940"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=7940"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}