


























Vector databases are explicitly designed to store and manage vector data, playing a crucial role in many AI applications, such as semantic text search and image search. While traditional term matching and BM25 algorithms still hold significance in text retrieval, the widely adopted Elasticsearch system has recently added vector search capabilities. Notably, MyScaleDB, an open-source, high-performance SQL vector database, has also introduced full-text search (opens new window) recently. In this article, we demonstrate that MyScaleDB rivals Elasticsearch in full-text search performance while achieving lower latency and utilizing 40% less memory. Furthermore, when incorporating vector search, MyScale achieves up to 10x higher performance while consuming only 12% of the cost. With its high performance, low cost, and a rich SQL ecosystem based on ClickHouse, MyScaleDB emerges as an efficient and powerful upgrade and alternative to Elasticsearch.
Elasticsearch is a distributed, RESTful search and analytics engine built on Apache Lucene. It can quickly store, search, and analyze large amounts of data and is widely used in areas such as log analyses, application searches, security analyses, and business analyses.
Elasticsearch has the following advantages:
However, Elasticsearch still has several shortcomings, including:
In summary, Elasticsearch is a powerful tool in the field of text retrieval. Still, it has some shortcomings in usability, vector retrieval, and resource utilization, which limit its application in complex AI retrieval and analysis scenarios.
MyScaleDB is built on the open-source SQL columnar storage database ClickHouse. It features a self-developed high-performance and high-data-density vector indexing algorithm. We have undergone deep research and optimization in its retrieval capabilities and storage engines for SQL and vector joint queries, making MyScaleDB the world’s first SQL vector database product that significantly surpasses dedicated vector databases in terms of comprehensive performance and cost-effectiveness.
Users interact with MyScaleDB using SQL, lowering the barriers to entry, and reducing the learning curve so that they can start quickly and ramp up easily. MyScaleDB offers a flexible data model and query language, supporting users in customizing data processing and analysis strategies according to their specific needs—and improving application flexibility and execution efficiency. Combining SQL and vectors in complex AI application scenarios gives developers a more intuitive and efficient development method, significantly increasing developer efficiencies.
Unlike Elasticsearch’s Domain Specific Language (DSL), which is based on JSON queries, users only need to master the vector retrieval distance() function for using MyScaleDB. They can develop complex vector retrieval queries with this information and their existing SQL knowledge. Moreover, they can also perform complex analyses and data processing at a database level, speeding up the overall processing efficiency of the application system.
For instance:
In the latest version, MyScaleDB has introduced powerful features such as full-text and hybrid search, providing practical solutions for handling complex AI requirements and data challenges now—and in the future. It embeds the Tantivy full-text search engine library, featuring fast index construction, efficient searching, and multithreading support. On top of it all, it is super easy to use, vastly flexible, and highly suitable for quickly retrieving large-scale text data. This allows users to quickly search text data stored in the database and return the result set that is the closest match—according to the BM25 scores.
For example, the following table contains the results of a text search capabilities test we ran on the same dataset, “wiki” (560 million records). MyScaleDB’s P95 query latency is significantly reduced, and there is also a noticeable decrease in memory usage. Thus, in the context of full-text search and in terms of functionality, MyScaleDB can effectively replace Elasticsearch.
| Engine | Function | QPS | p95 Latency | Peak Memory |
|---|---|---|---|---|
| MyScaleDB | TextSearch | 4099.16 | 4.563ms | 2.35GB |
| ElasticSearch | match | 3907 | 8.863ms | 3.7GB |
| ElasticSearch | wildcard | 4679.16 | 5.583ms | 3.7GB |
MyScaleDB utilizes vector retrieval technology and supports various vector indexing algorithms, including MTSG, SCANN, FLAT, and the HNSW and IVF families. This better meets the retrieval needs of various AI scenarios and has an absolute advantage in processing large-scale high-dimensional data.
Using a large-scale dataset (LAION 5M vectors, 768 dimensions), MyScaleDB and Elasticsearch's performance in vector search under different concurrent query threads was tested. The results of the accuracy and throughput tests are shown in the figure below.

This test tested two common filtering ratios, 0.1 and 0.01. An analysis of the results shows, under similar accuracy, MyScaleDB's MSTG index demonstrates up to 10x QPS performance improvement. MyScaleDB has similar advantages in terms of index resource consumption, creation time, query latency, and query cost.
More notably, MyScaleDB SaaS only costs $120 per month to serve 5 million vectors, while ElasticCloud is more than eight times as expensive at $982. Furthermore, MyScaleDB supports multiple types of vector indexes and, combined with its powerful retrieval performance and cost-effective usage costs, is more suitable for vector retrieval and analysis query scenarios than Elasticsearch.
You can refer to the MyScaleDB Vector Database Benchmark (opens new window) for more performance test results.
As described above, MyScaleDB is built on the high-performance columnar database ClickHouse, currently the fastest and most resource-efficient open-source database for real-time applications and analytics. Some of ClickHouse’s advanced features made it a good choice, including efficient indexing mechanism, data compression technology, columnar storage structure, vectorized query execution, and distributed processing capabilities.
Moreover, MyScaleDB’s query engine is optimized for modern CPUs and memory. It uses vectorized query processing and data parallel processing techniques to fully leverage the performance of multi-core processors, accelerating data calculations. Inheriting ClickHouse’s columnar storage model, MyScaleDB achieves efficient data compression and fast column-level operations. It can read only the columns specified in the query, reducing data read volume, improving data compression rates, and reducing storage costs, making it particularly suitable for analyzing and processing massive amounts of data.
In summary, by combining vector retrieval technology, the full-text search engine, Tantivy, ClickHouse’s high-performance features, distributed architecture, and optimized query engine, MyScaleDB achieves efficient processing and analysis of large-scale datasets. It is especially suited for complex data analysis, hybrid search, full-text search, and vector retrieval scenarios.
Boost Your AI App Efficiency now
Sign up for free to benefit from 150+ QPS with 5,000,000 vectors
This process involves tasks such as data modeling, data migration, and query logic conversion. Refer to the Quickstart (opens new window) guide for more information on quickly spinning up a MyScaleDB cluster, importing data, and executing SQL queries.

The data model design phase involves determining how to map the document model in Elasticsearch to the table structure in MyScaleDB. It primarily defines the columns, data types, and index types for the migrating data tables in MyScaleDB.
MyScaleDB is compatible with all ClickHouse’s data types; therefore, all field data types in Elasticsearch have corresponding data types in MyScaleDB.
Note:
The dense_vector type used for vector search in Elasticsearch should be mapped to Array(Float32) or FixedString in MyScaleDB based on the element_type. Secondly, the corresponding length constraint should be added to the column accordingly.
MyScaleDB supports multiple types of vector indexes. However, we strongly recommend using MSTG indexes for optimal performance.
Refer to the vector query tutorial (opens new window) for information on creating and operating vector indexes for accelerated vector search.
Here is an example that converts the image-index in Elasticsearch to the es_data_migration table in MyScaleDB:
This phase mainly involves exporting data from Elasticsearch and its subsequent import into MyScaleDB.
For instance, here is an example using Python client to migrate data files exported from Elasticsearch to MyScaleDB:
The original application's query retrieval logic—initially handled by Elasticsearch—has been changed to a MyScaleDB search, and the corresponding data processing logic has been updated accordingly.
Join Our Newsletter
Through a comparative analysis of the functionality and performance between MyScaleDB and Elasticsearch, it can be seen that MyScaleDB is not only an efficient replacement for—and upgrade to—Elasticsearch but also an advanced data solution that can adapt to future data needs and technology trends. It has significant advantages, especially in vector search and resource costs.
In addition, based on ClickHouse's powerful distributed storage and processing architecture, MyScaleDB is highly flexible in scalability, allowing it to scale to large clusters to meet growing data demands easily.
Furthermore, MyScaleDB is compatible with ClickHouse's ecosystem components, including abundant documentation resources and extensive community support. It is also integrated with popular developer tools worldwide, such as Python Client (opens new window), Node.js (opens new window), and the LLM framework, including OpenAI (opens new window), LangChain (opens new window), LangChain JS/TS (opens new window), and LlamaIndex (opens new window), providing users with a better user experience and support.
Lastly, MyScaleDB supports a wide range of data types and query syntax, making it adaptable to different data requirements and query scenarios. With its comprehensive SQL data management capabilities, robust data storage, and query capabilities, MyScaleDB will play an increasingly important role in data storage and processing in the future, providing users with richer and more efficient services.
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。