반응형

600===Dev AWS/ElasticSearch 4

Elasticsearch가 DB보다 빠른 이유: 비밀은 역색인! 🚀

안녕하세요! 오늘은 Elasticsearch가 왜 일반 DB보다 검색이 빠른지, 그 핵심 원리를 파헤쳐볼게요.DB vs Elasticsearch 검색 방식 비교 🤔일반 DB의 검색 방식SELECT * FROM books WHERE content LIKE '%elasticsearch%'테이블의 모든 row를 순차적으로 스캔 (Full Table Scan)마치 도서관에서 모든 책을 한권씩 펼쳐보는 것과 같아요!Elasticsearch의 검색 방식GET /books/_search{ "query": { "match": { "content": "elasticsearch" } }}미리 만들어둔 역색인(Inverted Index)을 통해 즉시 검색도서관의 색인 카드처럼, 단어별로 어디에 있는..

What is an inverted index, and why is it crucial for ElasticSearch?

An inverted index is a data structure that maps terms to the documents that contain them, making it crucial for ElasticSearch because it allows for rapid full-text searches.Inverted Index: The Core ConceptImagine you have a collection of books, and you want to find all the books that contain the word "quantum." Instead of scanning each book from start to finish, you could create an index that te..

728x90
반응형