Performance in Elasticsearch

49 Views Asked by At

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

1

There are 1 best solutions below

0
On

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.