Project

General

Profile

Actions

Refactor #5936

closed

Unnecessary call to FactName.maximum slows down ENC

Added by Daniel Lobato Garcia over 10 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Category:
External Nodes
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

As explained here: https://github.com/theforeman/foreman/pull/1477

The query "SELECT MAX AS maximum_id, name AS name FROM `fact_names` GROUP BY name ORDER BY fact_names.name" needs to be called only when there are facts to create. Calling it every time slows down every ENC call, especially when the fact_names table is large.

Actions

Also available in: Atom PDF