These are chat archives for ManageIQ/manageiq/performance
@Fryguy I'm facing a daunting task:
belongs_to filters traverse objects to find all the children, then all their children, following the filter (
parent_id type problem).
belongs_to filter generates a sql "query" that describes the relationship. this will get included into another query for filtering.
Does this seem doable? (this is the only area left in rbac that does this id lookup / merge gook)
"query"as air quotes -aka
tacticaland a BZ, then we are trying to give a fix to a customer asap
with_relationship_type('ems_metadata')is a little confusing
.childrenon a VM, it needs to know which tree
# /belongsto/ExtManagementSystem|<name>/EmsCluster|<name>/EmsFolder|<name>, I would rather have
has_many belongs_to_filtersand each one point at something in a table so it does not need parsing
host.ancestorsand you are done...you have the parent chain
host.ems_clusteror whatever if you need a specific level
vm.where(ems_cluster => host => $filter_hosts)
Rbac.get_belongsto_matchesto not hit the db but rather produce a (sub?)query
MiqFilter.belongsto2object_listwhich currently fetches ids at every level and then pulls back more ids at the next level.
belongs_torelationship to the tail and be done with it?
["/belongsto/ExtManagementSystem|VC01/EmsFolder|Datacenters/EmsFolder|Ctr1/EmsFolder|host/EmsCluster|CP-ETE", "/belongsto/ExtManagementSystem|VC01/EmsFolder|Datacenters/EmsFolder|Ctr1/EmsFolder|vm/EmsFolder|QA", "/belongsto/ExtManagementSystem|VC01/EmsFolder|Datacenters/EmsFolder|Ctr1/EmsFolder|vm/EmsFolder|Development", "/belongsto/ExtManagementSystem|VC01/EmsFolder|Datacenters/EmsFolder|Ctr1/EmsFolder|vm/EmsFolder|Templates"]