Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do additional date range filters increase the performance?

Tags:

To an existing, large ElasticSearch 5 index, I want to add a date field, containing the date of the indexation of each document. Afterwards I want to query this index, to return all documents, created in the last minute.

In the ElasticSearch Ultimative Guide for version 1 it is mentioned, that adding additional filters for day, month and/or year can improve the performance drastically. Newer versions of the guide do not say so anymore.

Can I gain performance in ElasticSearch 5 with adding additional date filters?

like image 461
slartidan Avatar asked Jul 11 '17 15:07

slartidan


People also ask

What is date range filter?

Date Range Filters are used to limit the results on a Dashboard to data that falls in (or outside of) certain date and time groupings. Date Range Filters are available for properties with Date, DateTime, and Time data types.

How do I set tableau dashboard filters to automatically update to most recent date?

To maintain the automatic updates, add the date variable as a Filter > Range of dates > Special > All dates. Now, the table will update to the most recent date inside of the date filters range.


1 Answers

Depending on the size of your index, it certainly would help restrain the amount of data that gets considered for your query.

If your index contains years of data, adding a filter to only consider the documents indexed during the last minute will considerably decrease the amount of data that will be focused on for your query.

It was the case with ES 1.x and it is still the case with ES 5.x, the only difference is that in 1.x you had to take care of properly ordering your filters to use the most aggressive filters first, which is not the case anymore in 5.x as ES is now smart enough to run the most aggressive filters first to make sure to weed out unnecessary data very early during the search process.

like image 151
Val Avatar answered Oct 11 '22 09:10

Val