{"id":15770,"date":"2024-05-28T15:11:01","date_gmt":"2024-05-28T22:11:01","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/?p=15770"},"modified":"2025-06-13T20:19:14","modified_gmt":"2025-06-14T03:19:14","slug":"querying-vectors-challenges","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/querying-vectors-challenges\/","title":{"rendered":"Querying Vectors And Things That Can Go Wrong With Them"},"content":{"rendered":"<p><span style=\"font-weight: 400;\">Couchbase 7.6 introduces <a href=\"https:\/\/www.couchbase.com\/blog\/announcing-vector-search\/\">Vector Search into the Couchbase architecture<\/a>, expanding its search capabilities by leaps and bounds. This article showcases how this affects search queries, how we have to adapt in certain situations and how to efficiently use this latest feature. To make sure your vector searches are the best they can be, you need to be aware of problems like slow queries caused by inefficient indexes, inefficient queries or frequently changing data as well as other failure cases like timeouts, consistency errors, app herder, etc.<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">Introducing Vector Queries<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Search queries had to be adapted to allow the use of vectors. It is essentially a new query type that allows <\/span><i><span style=\"font-weight: 400;\">similarity search<\/span><\/i><span style=\"font-weight: 400;\"> instead of exact search. The difference being that we are not looking for exact matches anymore when it comes to vectors, but the closest ones to the vector specified in the query:<\/span><\/p>\n<pre class=\"nums:false lang:js decode:true \">{\r\n\u00a0\u00a0\"query\": {\r\n\u00a0\u00a0\u00a0\u00a0\"match_none\": {}\r\n\u00a0\u00a0},\r\n\u00a0\u00a0\"knn\": [\r\n\u00a0\u00a0\u00a0\u00a0{\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"field\": \"vector\",\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"vector\": [0.04603520780801773, ...,\u00a0 -0.08424953371286392],\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"k\": 3\r\n\u00a0\u00a0\u00a0\u00a0}\r\n\u00a0\u00a0]\r\n}<\/pre>\n<p><span style=\"font-weight: 400;\">This is a vector query. It differs quite a bit from a regular query. All of the vector parts of the query are under a new key called <em>knn<\/em>, introduced for the sole purpose of vector queries. The <em>k<\/em> value in the query determines the number of documents you want in the results. This is necessary because instead of looking for the exact match, we are concerned about finding the <em>k<\/em> closest vectors to the query vector. This query will end up returning three vectors that search thinks is the closest to the query vector.<\/span><\/p>\n<pre class=\"nums:false lang:js decode:true \">{\r\n\u00a0\u00a0\"query\": \u201ccontent:car\u201d,\r\n\u00a0\u00a0\"knn\": [\r\n\u00a0\u00a0\u00a0\u00a0{\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"field\": \"vector\",\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"vector\": [0.04603520780801773, ...,\u00a0 -0.08424953371286392],\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"k\": 3\r\n\u00a0\u00a0\u00a0\u00a0}\r\n\u00a0\u00a0]\r\n}<\/pre>\n<p><span style=\"font-weight: 400;\">You can also combine a vector query with a regular query for a <\/span><a href=\"https:\/\/www.couchbase.com\/blog\/hybrid-search\/\"><i><span style=\"font-weight: 400;\">hybrid search<\/span><\/i><\/a><span style=\"font-weight: 400;\">. In this case, search does the query in two phases. This first phase will do the vector search, merges all of the results from the different partitions, and the second phase is where the regular search happens, utilizing the results from the first phase. This approach allows for a better performance in terms of both time and amount of data passed between the nodes.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Now that we know how to query vectors, let us go through the most common failure scenarios. What can go wrong during a vector query?<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">Identifying Slow Queries<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">One of the most common types of query failure is a slow query. A query which is stuck processing in the system for a long time is called a slow query. Depending on the timeout set for this query, it can stay running for a long time.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">There are many reasons why this happens. One of the simplest reasons for a slow query is that it is too expensive to run. This can be due to it referencing too many documents, the number of documents indexed is huge or the type of query is a comparatively inefficient one.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">In vector terms, the most common causes of a slow query is due to a large index size with an insufficient number of partitions, a large K value in the query, or even a high data ingest rate.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Now that we know what a slow query is, the next question that comes to mind is, how do you know there is a slow query still running? One of the best ways of doing this is to check the logs. A slow query will be logged every 5 seconds. This timer can be changed using the manager options and the log line will look like:<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><a href=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2024\/05\/image1-2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-15771\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2024\/05\/image1-2.png\" alt=\"\" width=\"570\" height=\"128\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2024\/05\/image1-2.png 570w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2024\/05\/image1-2-300x67.png 300w\" sizes=\"auto, (max-width: 570px) 100vw, 570px\" \/><\/a><\/span><\/p>\n<p><span style=\"font-weight: 400;\">Another way is to look at the stats. There is a stat available in the <\/span><i><span style=\"font-weight: 400;\">\/api\/nsstats<\/span><\/i><span style=\"font-weight: 400;\"> endpoint called <\/span><i><span style=\"font-weight: 400;\">total_queries_slow<\/span><\/i><span style=\"font-weight: 400;\"> which will log the number of times a slow query has been detected:<\/span><\/p>\n<p><a href=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2024\/05\/image8.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-15778\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2024\/05\/image8.png\" alt=\"\" width=\"498\" height=\"109\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2024\/05\/image8.png 498w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2024\/05\/image8-300x66.png 300w\" sizes=\"auto, (max-width: 498px) 100vw, 498px\" \/><\/a><\/p>\n<p><span style=\"font-weight: 400;\">There are also a few more stats that you can observe in the same endpoint that might give us some clue as to what is happening to the query internally and where the trouble might be:<\/span><\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">avg_grpc_internal_queries_latency &#8211; <\/span><span style=\"font-weight: 400;\">Average time taken at the grpc level for processing a query coming in from a different node<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">avg_grpc_queries_latency &#8211;\u00a0<\/span><span style=\"font-weight: 400;\">Average time taken at the grpc level for processing a query originating in the same node<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">avg_internal_queries_latency &#8211;\u00a0<\/span><span style=\"font-weight: 400;\">Average time taken for processing a query coming in from a different node<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">avg_queries_latency &#8211; <\/span><span style=\"font-weight: 400;\">Average time taken for processing a query originating in the same node<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h2><span style=\"font-weight: 400;\">Factors Contributing to Slow Queries<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Now that we know how to identify a slow query, the next step is to understand why it happens and what we can do to minimize it.<\/span><\/p>\n<h3><span style=\"font-weight: 400;\">Inefficient Index<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">One of the major factors is the index itself, the number of vectors indexed, the number of partitions, or the number of nodes. Each of these factors are crucial when it comes to query performance.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The number of vectors indexed is a pretty self explanatory factor, the more the number of vectors, the longer it will take to query them. As of 7.6.0 this can be roughly inferred from the number of documents but the following maintenance patch will have a stat which gives us the exact value.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The number of partitions and nodes can be explained somewhat intuitively. Let&#8217;s take an example of a person going through a bunch of papers on his desk.<\/span><\/p>\n<p><a href=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2024\/05\/image3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone  wp-image-15773\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2024\/05\/image3.png\" alt=\"\" width=\"551\" height=\"333\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2024\/05\/image3.png 880w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2024\/05\/image3-300x181.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2024\/05\/image3-768x464.png 768w\" sizes=\"auto, (max-width: 551px) 100vw, 551px\" \/><\/a><\/p>\n<p><span style=\"font-weight: 400;\">There are&#8217;s a lot of papers and only one person so it takes him longer to find what he wants. Now let&#8217;s add one more person at the same desk going through half the documents. This obviously reduces the amount of time to find the correct documents.<\/span><\/p>\n<p><a href=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2024\/05\/image4.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone  wp-image-15774\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2024\/05\/image4.png\" alt=\"\" width=\"484\" height=\"344\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2024\/05\/image4.png 694w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2024\/05\/image4-300x214.png 300w\" sizes=\"auto, (max-width: 484px) 100vw, 484px\" \/><\/a><\/p>\n<p><span style=\"font-weight: 400;\">We can continue adding more people at the same desk, but after a point, you run out of desk space for the people, some of them are waiting around because the desk is too crowded.<\/span><\/p>\n<p><a href=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2024\/05\/image5.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone  wp-image-15775\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2024\/05\/image5.png\" alt=\"\" width=\"540\" height=\"341\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2024\/05\/image5.png 820w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2024\/05\/image5-300x190.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2024\/05\/image5-768x485.png 768w\" sizes=\"auto, (max-width: 540px) 100vw, 540px\" \/><\/a><br style=\"font-weight: 400;\" \/><br style=\"font-weight: 400;\" \/><\/p>\n<p><span style=\"font-weight: 400;\">The simplest solution is to just add another desk or get a bigger desk, this allows more people to sit down and go through the papers at once.<\/span><\/p>\n<p><a href=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2024\/05\/image2-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone  wp-image-15772\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2024\/05\/image2-1-1024x435.png\" alt=\"\" width=\"542\" height=\"230\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2024\/05\/image2-1-1024x435.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2024\/05\/image2-1-300x128.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2024\/05\/image2-1-768x327.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2024\/05\/image2-1.png 1270w\" sizes=\"auto, (max-width: 542px) 100vw, 542px\" \/><\/a><\/p>\n<p><span style=\"font-weight: 400;\">This example is similar to the search ecosystem. The people are the partitions, the papers are the vectors, the desks are the nodes. A larger number of desks mean a larger amount of resources to handle more people. More people means a faster search but too many people means more communication between them to get the results which will again be counter productive. There is a right balance to every system and it is important to find it for efficiency.<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">Inefficient Query<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Another major factor that determines the amount of time a vector query spends in the system is the K value. A larger K value means that each index partition takes longer to process the query, a larger amount of data needs to be transferred between nodes, larger buffers needed to hold all of this data to condense each partition\u2019s K results (<\/span><i><span style=\"font-weight: 400;\">total K * number of partitions worth of results<\/span><\/i><span style=\"font-weight: 400;\">) into the final K results. Each of these steps takes increasingly longer as the value of K increases.<\/span><\/p>\n<p><a href=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2024\/05\/image7.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-15777\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2024\/05\/image7-1024x389.png\" alt=\"\" width=\"900\" height=\"342\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2024\/05\/image7-1024x389.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2024\/05\/image7-300x114.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2024\/05\/image7-768x292.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2024\/05\/image7-1536x584.png 1536w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2024\/05\/image7-1320x502.png 1320w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2024\/05\/image7.png 1999w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><\/a><\/p>\n<p><span style=\"font-weight: 400;\">Going back to the previous example, a large K value will mean each person will need to track a larger stack of papers, and when everyone is done, they now need to compare all of the stacks of papers they shortlisted to find the K best documents.<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">Constantly Changing Data<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">The final piece in this puzzle is the documents itself. Search follows an append only architecture. This means that every change in the document is appended and indexed and stored separately instead of rewriting the existing document entry. With a large number of changes to the actual documents, we get a very busy index with constant creation of segments and constant merging of these segments. These operations take up a lot of resources which will affect the queries as they won\u2019t have a lot left to work with.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Think of it like having people getting you new stacks of papers while you are trying to find what you are looking for. It&#8217;s messy, you don\u2019t have enough desk space, new papers are constantly coming in and you need to track duplicates in case it&#8217;s an updated paper.<\/span><\/p>\n<p><a href=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2024\/05\/image6.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone  wp-image-15776\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2024\/05\/image6-1024x438.png\" alt=\"\" width=\"631\" height=\"270\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2024\/05\/image6-1024x438.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2024\/05\/image6-300x128.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2024\/05\/image6-768x328.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2024\/05\/image6-1536x657.png 1536w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2024\/05\/image6-1320x565.png 1320w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2024\/05\/image6.png 1999w\" sizes=\"auto, (max-width: 631px) 100vw, 631px\" \/><\/a><\/p>\n<h2>Other Issues<\/h2>\n<p><span style=\"font-weight: 400;\">Slow queries aren\u2019t the only reason a query might fail. Some of the other failures scenarios include:<\/span><\/p>\n<p style=\"padding-left: 40px;\"><strong>Query timeout<\/strong><\/p>\n<p style=\"padding-left: 40px;\"><span style=\"font-weight: 400;\">This is a slow query hitting the max time limit set by the user. It is caused by the same reasons as slow queries and is tracked by total_queries_timeout.<\/span><\/p>\n<p style=\"padding-left: 40px;\"><strong>Max result window exceed<\/strong><\/p>\n<p style=\"padding-left: 40px;\"><span style=\"font-weight: 400;\">This happens when you have a query needing more hits than the maxResultWindow limit set for the cluster. This value by default is 10000 but can be configured through the manager options API. It exists to prevent accidental streaming of large amounts of data.<\/span><\/p>\n<p style=\"padding-left: 40px;\"><strong>Partial Results<\/strong><\/p>\n<p style=\"padding-left: 40px;\"><span style=\"font-weight: 400;\">This happens when one of the partitions is unavailable and didn\u2019t send its results to the node that received the query.<\/span><\/p>\n<p style=\"padding-left: 40px;\"><strong>Rejected by app herder<\/strong><\/p>\n<p style=\"padding-left: 40px;\"><span style=\"font-weight: 400;\">The app herder is the final checkpointing in place to ensure that the system\u2019s resources stay within the given limits. When a query threatens to exceed the limit, which can happen due to a large query load or indexing load or a rebalance operation or some combination of all three, app herder preemptively shuts down the query preventing its execution.<\/span><\/p>\n<p style=\"padding-left: 40px;\"><strong>Search in context failure<\/strong><\/p>\n<p style=\"padding-left: 40px;\"><span style=\"font-weight: 400;\">This covers all of the possible errors that can happen within bleve like any issues with interacting with the index files and such.<\/span><\/p>\n<p style=\"padding-left: 40px;\"><strong>Consistency errors<\/strong><\/p>\n<p style=\"padding-left: 40px;\"><span style=\"font-weight: 400;\">Errors in specifying the consistency parameters cause a query to fail. These parameters include the level of consistency of data, the results and other related variables.<\/span><\/p>\n<p style=\"padding-left: 40px;\"><strong>Bad Requests<\/strong><\/p>\n<p style=\"padding-left: 40px;\"><span style=\"font-weight: 400;\">This is the simplest one which is basically user error in making a query. It could range from a typo, bad json structure to invalid query strings.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The introduction of vector search expands Couchbase&#8217;s search capabilities beyond previous boundaries and use cases. To leverage this feature effectively, users need to understand its functionalities, including querying, indexing data, and managing system behaviors under various conditions. For an even deeper understanding of vector search, its functionality, and capabilities, explore some of the other blogs on our site.<\/span><\/p>\n<h2>Next Steps<\/h2>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>Read more about <a href=\"https:\/\/www.couchbase.com\/blog\/category\/vector-search\/\">Vector Search concepts<\/a> in our blogs, including tutorials and concepts.<\/li>\n<li><a href=\"https:\/\/couchbase.com\/products\/capella\/\">Couchbase Capella&#8217;s free trial<\/a> includes vector search, among many other features. Give it a try today.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><a href=\"https:\/\/couchbase.com\/products\/capella\/\"><img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-15744 aligncenter\" style=\"border: solid 1px; border-radius: 25px;\" src=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2024\/05\/Screenshot-2024-05-22-at-2.40.17\u202fPM-1024x357.png\" alt=\"\" width=\"900\" height=\"314\" srcset=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2024\/05\/Screenshot-2024-05-22-at-2.40.17\u202fPM-1024x357.png 1024w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2024\/05\/Screenshot-2024-05-22-at-2.40.17\u202fPM-300x105.png 300w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2024\/05\/Screenshot-2024-05-22-at-2.40.17\u202fPM-768x268.png 768w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2024\/05\/Screenshot-2024-05-22-at-2.40.17\u202fPM-1536x536.png 1536w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2024\/05\/Screenshot-2024-05-22-at-2.40.17\u202fPM-2048x715.png 2048w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2024\/05\/Screenshot-2024-05-22-at-2.40.17\u202fPM-800x280.png 800w, https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2024\/05\/Screenshot-2024-05-22-at-2.40.17\u202fPM-1320x461.png 1320w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Couchbase 7.6 introduces Vector Search into the Couchbase architecture, expanding its search capabilities by leaps and bounds. This article showcases how this affects search queries, how we have to adapt in certain situations and how to efficiently use this latest [&hellip;]<\/p>\n","protected":false},"author":85298,"featured_media":15777,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[10122,2225,1816,9417,9936,9937],"tags":[9966],"ppma_author":[9972],"class_list":["post-15770","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-artificial-intelligence-ai","category-cloud","category-couchbase-server","category-performance","category-search","category-vector-search","tag-hybrid-search"],"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>Querying Vectors And Things That Can Go Wrong With Them - The Couchbase Blog<\/title>\n<meta name=\"description\" content=\"For the best vector searches, you need to be aware of slow queries caused by inefficient indexes, inefficient queries or frequently changing data, etc.\" \/>\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\/querying-vectors-challenges\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Querying Vectors And Things That Can Go Wrong With Them\" \/>\n<meta property=\"og:description\" content=\"For the best vector searches, you need to be aware of slow queries caused by inefficient indexes, inefficient queries or frequently changing data, etc.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/querying-vectors-challenges\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:published_time\" content=\"2024-05-28T22:11:01+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-14T03:19:14+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2024\/05\/image7.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1999\" \/>\n\t<meta property=\"og:image:height\" content=\"760\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Likith B, Software Engineer\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Likith B, Software Engineer\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/querying-vectors-challenges\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/querying-vectors-challenges\/\"},\"author\":{\"name\":\"Likith B, Software Engineer\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/dd7ad9b8eb78bdce2fe68e940518a7f6\"},\"headline\":\"Querying Vectors And Things That Can Go Wrong With Them\",\"datePublished\":\"2024-05-28T22:11:01+00:00\",\"dateModified\":\"2025-06-14T03:19:14+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/querying-vectors-challenges\/\"},\"wordCount\":1691,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/querying-vectors-challenges\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2024\/05\/image7.png\",\"keywords\":[\"hybrid search\"],\"articleSection\":[\"Artificial Intelligence (AI)\",\"Couchbase Capella\",\"Couchbase Server\",\"High Performance\",\"Search\",\"Vector Search\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/querying-vectors-challenges\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/querying-vectors-challenges\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/querying-vectors-challenges\/\",\"name\":\"Querying Vectors And Things That Can Go Wrong With Them - The Couchbase Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/querying-vectors-challenges\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/querying-vectors-challenges\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2024\/05\/image7.png\",\"datePublished\":\"2024-05-28T22:11:01+00:00\",\"dateModified\":\"2025-06-14T03:19:14+00:00\",\"description\":\"For the best vector searches, you need to be aware of slow queries caused by inefficient indexes, inefficient queries or frequently changing data, etc.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/querying-vectors-challenges\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/querying-vectors-challenges\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/querying-vectors-challenges\/#primaryimage\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2024\/05\/image7.png\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2024\/05\/image7.png\",\"width\":1999,\"height\":760},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/querying-vectors-challenges\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.couchbase.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Querying Vectors And Things That Can Go Wrong With Them\"}]},{\"@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\/dd7ad9b8eb78bdce2fe68e940518a7f6\",\"name\":\"Likith B, Software Engineer\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/a834fd56b316ec42fcf7705d52c8e604\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/ebf7761bbd5fa10448361e3b6fcb229cf6c297eee4be1b3ce3a3e391896cb098?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/ebf7761bbd5fa10448361e3b6fcb229cf6c297eee4be1b3ce3a3e391896cb098?s=96&d=mm&r=g\",\"caption\":\"Likith B, Software Engineer\"},\"url\":\"https:\/\/www.couchbase.com\/blog\/author\/likithb\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Querying Vectors And Things That Can Go Wrong With Them - The Couchbase Blog","description":"For the best vector searches, you need to be aware of slow queries caused by inefficient indexes, inefficient queries or frequently changing data, etc.","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\/querying-vectors-challenges\/","og_locale":"en_US","og_type":"article","og_title":"Querying Vectors And Things That Can Go Wrong With Them","og_description":"For the best vector searches, you need to be aware of slow queries caused by inefficient indexes, inefficient queries or frequently changing data, etc.","og_url":"https:\/\/www.couchbase.com\/blog\/querying-vectors-challenges\/","og_site_name":"The Couchbase Blog","article_published_time":"2024-05-28T22:11:01+00:00","article_modified_time":"2025-06-14T03:19:14+00:00","og_image":[{"width":1999,"height":760,"url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2024\/05\/image7.png","type":"image\/png"}],"author":"Likith B, Software Engineer","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Likith B, Software Engineer","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/querying-vectors-challenges\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/querying-vectors-challenges\/"},"author":{"name":"Likith B, Software Engineer","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/dd7ad9b8eb78bdce2fe68e940518a7f6"},"headline":"Querying Vectors And Things That Can Go Wrong With Them","datePublished":"2024-05-28T22:11:01+00:00","dateModified":"2025-06-14T03:19:14+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/querying-vectors-challenges\/"},"wordCount":1691,"commentCount":1,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/querying-vectors-challenges\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2024\/05\/image7.png","keywords":["hybrid search"],"articleSection":["Artificial Intelligence (AI)","Couchbase Capella","Couchbase Server","High Performance","Search","Vector Search"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/querying-vectors-challenges\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/querying-vectors-challenges\/","url":"https:\/\/www.couchbase.com\/blog\/querying-vectors-challenges\/","name":"Querying Vectors And Things That Can Go Wrong With Them - The Couchbase Blog","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/querying-vectors-challenges\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/querying-vectors-challenges\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2024\/05\/image7.png","datePublished":"2024-05-28T22:11:01+00:00","dateModified":"2025-06-14T03:19:14+00:00","description":"For the best vector searches, you need to be aware of slow queries caused by inefficient indexes, inefficient queries or frequently changing data, etc.","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/querying-vectors-challenges\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/querying-vectors-challenges\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/querying-vectors-challenges\/#primaryimage","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2024\/05\/image7.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2024\/05\/image7.png","width":1999,"height":760},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/blog\/querying-vectors-challenges\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Querying Vectors And Things That Can Go Wrong With Them"}]},{"@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\/dd7ad9b8eb78bdce2fe68e940518a7f6","name":"Likith B, Software Engineer","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/a834fd56b316ec42fcf7705d52c8e604","url":"https:\/\/secure.gravatar.com\/avatar\/ebf7761bbd5fa10448361e3b6fcb229cf6c297eee4be1b3ce3a3e391896cb098?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ebf7761bbd5fa10448361e3b6fcb229cf6c297eee4be1b3ce3a3e391896cb098?s=96&d=mm&r=g","caption":"Likith B, Software Engineer"},"url":"https:\/\/www.couchbase.com\/blog\/author\/likithb\/"}]}},"authors":[{"term_id":9972,"user_id":85298,"is_guest":0,"slug":"likithb","display_name":"Likith B, Software Engineer","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/ebf7761bbd5fa10448361e3b6fcb229cf6c297eee4be1b3ce3a3e391896cb098?s=96&d=mm&r=g","author_category":"","last_name":"B, Software Engineer","first_name":"Likith","job_title":"","user_url":"","description":""}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/15770","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\/85298"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/comments?post=15770"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/15770\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/media\/15777"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/media?parent=15770"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/categories?post=15770"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/tags?post=15770"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=15770"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}