Home / Companies / Couchbase / Blog / Post Details
Content Deep Dive

FTS and N1QL: Better MongoDB in Operator Performance Querying Multiple Arrays

Blog post from Couchbase

Post Details
Company
Date Published
Author
Brian Kane, Solutions Engineer, Couchbase
Word Count
4,690
Language
English
Hacker News Points
-
Summary

Couchbase Full Text Search (FTS) offers a more efficient alternative to Global Secondary Index (GSI) for indexing and querying multiple arrays, as demonstrated using the Travel Sample dataset. The example involves searching hotel documents based on public likes and reviews using N1QL queries, encountering limitations with GSI's inability to index multiple arrays in a single query due to b-tree index restrictions. By creating separate array indexes with Couchbase N1QL Index Advisor, the queries run successfully but inefficiently, fetching excessive documents. In contrast, FTS allows for a single index on multiple arrays, significantly improving performance by returning the necessary documents faster with reduced resource usage. Utilizing the SEARCH() function in N1QL, the FTS solution returns the same results in a fraction of the time, showcasing the integration's capability to enhance query performance and system efficiency by overcoming GSI's limitations.