Project

General

Profile

Actions

Refactor #25053

closed

Run expensive db_facts query just once and unordered

Added by Lukas Zapletal over 6 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Normal
Category:
Facts
Target version:
-
Fixed in Releases:
Found in Releases:

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.

https://community.theforeman.org/t/foreman-1-18-2-fact-query-on-puppet-report-upload-fact-import-incredibly-slow/11238


Related issues 1 (0 open1 closed)

Related to Foreman - Bug #25923: Puppet fact processing failed for hosts with large number of LUNs attachedClosedLukas ZapletalActions
Actions #1

Updated by The Foreman Bot over 6 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/6093 added
Actions #2

Updated by The Foreman Bot about 6 years ago

  • Pull request https://github.com/theforeman/foreman/pull/6108 added
Actions #3

Updated by The Foreman Bot about 6 years ago

  • Pull request https://github.com/theforeman/foreman/pull/6130 added
Actions #4

Updated by Tomer Brisker about 6 years ago

  • Pull request deleted (https://github.com/theforeman/foreman/pull/6108)
  • Fixed in Releases 1.20.0 added
Actions #5

Updated by Lukas Zapletal about 6 years ago

  • Status changed from Ready For Testing to Closed
Actions #6

Updated by Tomer Brisker almost 6 years ago

  • Related to Bug #25923: Puppet fact processing failed for hosts with large number of LUNs attached added
Actions

Also available in: Atom PDF