After upgrading from Elasticsearch 7.4.0 to 7.17 .1, the queries are taking too long to return result

Recently we have upgraded from Elasticsearch 7.4.0 to 7.17.1 and after the upgrade certain queries which were giving results immediately in 7.4.0, are now taking too long to return result.
For reference a query which was returning result instantly in 7.4.0 is now taking around 40 seconds to return results in 7.17.1.

I am using the same configuration for 7.17.1 as I was using in Elasticsearch 7.4.0. Initially I observed that there was a lot of full GC and CPU utilization so doubled the heap size after which the full GC and CPU utilization are now in control.

However, even after this the time taken by the response did not decrease.

Regarding the index, if I run curl -X GET "localhost:9200/my-index-000001/_count", I get a count of 35 million.

Because of this huge time lag we had to rollback to Elasticsearch 7.4.0, and after the rollback the situation is back to normal.

We would like to understand how we can address this issue? Is there anything which we can look into or compare between the versions?

Upon further investigation I observed that normal queries are working with out much delay, however whenever there is Wildcard query involved the delay increases hundredfold.

Is there any particular change between 7.4.0 and 7.17.1 that might be causing this? And is there a way to address this?

Hey :wave:t3:

Some thoughts:

  • do not use wildcards. It's slow as the doc says it
  • Use the latest 7.17 when running your tests. It might have been fixed in a later version. Or better switch to 8.14 and use the wildcard type which is designed for such use case.

I don't have the answer to your specific question though.

Could you share your query?