Project

General

Profile

Bug #18843

Change eager_load to includes statement in hosts api controller's index action

Added by Shimon Shtein over 2 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Database
Target version:
Difficulty:
Triaged:
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

Since the query is pretty wide (contains multiple joins) the execution plan will try to make all joins and only then try to filter unnecessary rows. This causes PG to load a huge temporary table into memory, and since it's too big to fit in, the CPU sky rockets.

Associated revisions

Revision a60d71e6 (diff)
Added by Shimon Shtein over 2 years ago

Fixes #18843 - Changed from eager_load to includes in #index

Avoiding multiple joins that result in very wide result rows.
It leads to big memory footprint in the DB especially on big datasets.
This big footprint translates then into DB high CPU usage while
processing the query.

Revision 0b19d771 (diff)
Added by Shimon Shtein over 2 years ago

Fixes #18843 - Changed from eager_load to includes in #index

Avoiding multiple joins that result in very wide result rows.
It leads to big memory footprint in the DB especially on big datasets.
This big footprint translates then into DB high CPU usage while
processing the query.
(cherry picked from commit a60d71e65b063a84f637ed4d17d0053038da9da5)

History

#1 Updated by Dominic Cleal over 2 years ago

  • Category set to Database

#2 Updated by The Foreman Bot over 2 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to Shimon Shtein
  • Pull request https://github.com/theforeman/foreman/pull/4365 added

#3 Updated by Ivan Necas over 2 years ago

  • Target version set to 1.12.2

#4 Updated by Shimon Shtein over 2 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#5 Updated by Dominic Cleal over 2 years ago

  • Legacy Backlogs Release (now unused) set to 227

Also available in: Atom PDF