Bug 1375348 - ArVirtual - Ownership uses virtual attributes / delegates
Summary: ArVirtual - Ownership uses virtual attributes / delegates
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Performance
Version: 5.6.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: GA
: 5.7.0
Assignee: Keenan Brock
QA Contact: Pradeep Kumar Surisetty
URL:
Whiteboard:
Depends On:
Blocks: 1376175
TreeView+ depends on / blocked
 
Reported: 2016-09-12 18:51 UTC by John Prause
Modified: 2019-08-06 20:05 UTC (History)
4 users (show)

Fixed In Version: 5.7.0.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1376175 (view as bug list)
Environment:
Last Closed: 2016-12-21 11:31:35 UTC
Category: ---
Cloudforms Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description John Prause 2016-09-12 18:51:36 UTC
Speeds up "VMs & Instances I Own" index and ajax calls in the /vm_or_template (Services -> Workload) section of the application.

Followup to #10290 and alternative to #10525
This is more similar to the #10290 approach. Further PRs will leverage virtual_delegates.
@NickLaMuro found where to optimize, wrote up the description, an was gracious enough to let me throw my hat into the ring.
How

This adds virtual_attribute on to the ownership_mixin, which is used by a few classes and makes it so that MiqExpressions will evaluate filter in SQL instead of pulling down all matching records to then iterate over and filter in Ruby (causes a Massive N+1 on large datasets).

Comment 2 John Prause 2016-09-12 18:52:24 UTC
https://github.com/ManageIQ/manageiq/pull/10704

Comment 5 Archit Sharma 2016-12-21 11:15:48 UTC
This BZ talks about PR 10704 which was implemented within the same context as PR 10685 (as per my discussion with ui perf dev team) 

..and the corresponding BZ https://bugzilla.redhat.com/show_bug.cgi?id=1375346 has been verified. 


That said, pasting the numbers from #1375346 for reference:

Quantifier Data: {
  "pages": {
      "vm_or_template/explorer": {
      "navigations": 6, 
      "200": 6, 
      "timings": [
        { "200": 9.11 }, 
        { "200": 1.67 }, 
        { "200": 2.75 }, 
        { "200": 2.01 }, 
        { "200": 1.15 }, 
        { "200": 1.8 }
      ]
    }
  }, 
  "number of requests": 6
}

an explicit test using curl against the POST route for the filter is not straight-forward at the moment, but the improvements from the fix have been confirmed by the team.


Note You need to log in before you can comment on or make changes to this bug.