These are chat archives for ManageIQ/manageiq/performance
flat_maponto relations so they just do the right thing
:throughin relations - for caching reasons?
:through, and the code wants to use the intermediary, it can be worse
:throughrelation is any slower than a normal HABTM with just a join table.
virtual_delegates, help? From it’s beginning it doesn’t look like anything more than a different sugar than the code it replaces (
virtual_column :blah, :uses => :foo) ManageIQ/manageiq@443eb85
:usesat this point, then? Should it be deprecated…?
virtual_attributesis it is a
virtual_attributethat also defines the
rubymethod for you.
:usesshould be deprecated, but it was used by 1 case and I didn't want to fight that PR battle when converting it across to using delegates
@Fryguy do you have a major opinion on this single line change?
It prevents us from downloading the whole tree when we are trying to filter.
:uses? “Fix code so they don’t use delegates”, you mean “use
So for example for this line: https://github.com/ManageIQ/manageiq/blob/ffd25b04/app/models/vm_or_template.rb#L179
It would not only define a
virtual_attribute (same thing as a
virtual_column), but also the delegate method to be used by ruby, and
arel to access it via SQL.
selectPR, we "can" do it, but should we ;)
sort_byon the query for no reason.