Project

General

Profile

Actions

Refactor #1955

open

improve host deletion speed

Added by Ohad Levy over 11 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

Currently both facts and reports (and their log join) are deleted using dependent => :destroy

this costs a lot of time because:
  1. each value is deleted in a single SQL
  2. each AR object is initiated.

possible solutions:

  • use dependent => :destroy_all which would fix 2
  • use delete_all to delete all id's in a single query (one for facts, one for reports and another for logs).

since we are not doing any auditing on facts currently, it might be save enough to use delete_all (and remove about 70% of the time it takes to delete a host).


Related issues 1 (0 open1 closed)

Related to Foreman - Bug #8316: Removing a long-standing host creates huge transactionClosedDaniel Lobato Garcia11/07/2014Actions
Actions #1

Updated by Daniel Lobato Garcia over 9 years ago

  • Related to Bug #8316: Removing a long-standing host creates huge transaction added
Actions

Also available in: Atom PDF