Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
140 views
in Technique[技术] by (71.8m points)

Performance in Elasticsearch

I am now beginning with elasticsearch.

I have two cases of data in a relational database, but in both cases I want to find the records from the first table as quickly as possible.

  • Case 1: binding tables 1: n (example Invoice - Items of invoice)

    Have I been to save the data to the elasticsearch system: all rows from slave or master_id and group all data from slave to single string?

  • Case 2: binding tables n: 1 (example Invoice - Customer)

    Have I been to save the data as in case 1 to independent index or add next column to previous index?

The problem is that sometimes I only need to search for records that contain a specific invoice item, sometimes a specific customer, and sometimes both an invoice item and a customer.

Should I create one index containing all the data, or all 3 variants?

Another problem, is it possible to speed up the search in elasticsearch somehow, when the stored data is eg only EAN (13 digit number) but not plain text?

Thank

Jaroslav


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You should denormalize and just use single index for all your data(invoices, items and customer) for the best performance, Elasticsearch although supports joins and parent-child relationship but their performance is no where near to when all the data is part of single index and quick benchmark test on your data will prove it easily.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...