Actions
Refactor #25053
closedRun expensive db_facts query just once and unordered
Difficulty:
Triaged:
No
Description
It looks like this query is very expensive on MySQL: host.fact_values.where(:fact_name => fact_names.values).reorder('')
We call it twice currently while it is not needed to run this query twice, we can fetch the list of fact value IDs stored in database in update step and prepare list of facts to be added in the next step in advance.
Also we order the query by ID for some reason, we can process them unordered just fine.
Actions