These are chat archives for ManageIQ/manageiq/performance

9th
Dec 2015
Joe Rafaniello
@jrafanie
Dec 09 2015 03:18
@kbrock a little late but that memoist question... maybe? But is that query actually returning all of the infra managers when we can just pluck the ids?
Keenan Brock
@kbrock
Dec 09 2015 03:19
it only needed to know if it existed
Joe Rafaniello
@jrafanie
Dec 09 2015 03:19
(the original code, not your sql)
Keenan Brock
@kbrock
Dec 09 2015 03:19
used the timer clause from storages
the new one is a subquery
no ems come back
Joe Rafaniello
@jrafanie
Dec 09 2015 03:20
  def self.openstack_hosts_exists?
    ems = ManageIQ::Providers::Openstack::InfraManager.pluck(:id)
    Host.where(:ems_id => ems).exists?
  end

  def self.non_openstack_hosts_exists?
    ems = ManageIQ::Providers::Openstack::InfraManager.pluck(:id)
    Host.where.not(:ems_id => ems).exists?
  end
Keenan Brock
@kbrock
Dec 09 2015 03:20
yea, that code shows the sql
Joe Rafaniello
@jrafanie
Dec 09 2015 03:20
or something
Keenan Brock
@kbrock
Dec 09 2015 03:20
that is 2 queries
er - 3. one is cached
one i showed is 1 query each
anyway
Joe Rafaniello
@jrafanie
Dec 09 2015 03:21
but yeah, it's silly, I'm not sure why we have those methods in the first place
Keenan Brock
@kbrock
Dec 09 2015 03:21
+1
Joe Rafaniello
@jrafanie
Dec 09 2015 03:21
it feels like a conditional driven thing
seems that memoist does that for us
Joe Rafaniello
@jrafanie
Dec 09 2015 03:23
it's similar but different
Keenan Brock
@kbrock
Dec 09 2015 03:23
it is minor anyway. much smaller than the other 37 queries on the page
Joe Rafaniello
@jrafanie
Dec 09 2015 03:23
memoist doesn't expire
you have to flush memoist
Keenan Brock
@kbrock
Dec 09 2015 03:23
ok
gem is popular enough, would have thought it would have it
Joe Rafaniello
@jrafanie
Dec 09 2015 03:23
but anyway, yeah, I would not want to cache when we have Object problem
Keenan Brock
@kbrock
Dec 09 2015 03:24
you object to caching? (sorry)
Joe Rafaniello
@jrafanie
Dec 09 2015 03:24
If openstack is so different here, we should treat the problem, not cache it
Keenan Brock
@kbrock
Dec 09 2015 03:24
caching a true/false isn't so bad
no, it is displaying the ui differently if there are mixed environments
Joe Rafaniello
@jrafanie
Dec 09 2015 03:24
yeah, caching is hard, avoid it unless we have to
Keenan Brock
@kbrock
Dec 09 2015 03:25
"I object to caching when we have Object problem"
Joe Rafaniello
@jrafanie
Dec 09 2015 03:25
too many ||= bugs where it didn't really provide much benefit
Keenan Brock
@kbrock
Dec 09 2015 03:25
never mind
yes
Joe Rafaniello
@jrafanie
Dec 09 2015 03:26
calling something hundreds of times is fine ;-)
at least most of the time
you get the idea, while I agree with you, it could be cached, it sounds like you found a good one to find a "better way" to lay things out
Keenan Brock
@kbrock
Dec 09 2015 03:27
yea. in truth, I'm annoyed that we call it at all
Joe Rafaniello
@jrafanie
Dec 09 2015 03:27
good night again :-) Wanted to ping you back since I forgot to reply to your question earlier
Keenan Brock
@kbrock
Dec 09 2015 03:27
there are a number of queries in the layout around openstack
Joe Rafaniello
@jrafanie
Dec 09 2015 03:27
yeah, question them all
Keenan Brock
@kbrock
Dec 09 2015 03:27
for vmware only ems installs
Joe Rafaniello
@jrafanie
Dec 09 2015 03:27
please!!
Keenan Brock
@kbrock
Dec 09 2015 03:27
I'm yack shaving
Joe Rafaniello
@jrafanie
Dec 09 2015 03:28
0 calls is faster than any number of calls
Keenan Brock
@kbrock
Dec 09 2015 03:28
I want to get rid of all our .present? / .empty? calls - too many count(*) from database
Joe Rafaniello
@jrafanie
Dec 09 2015 03:28
;-)
ok, good night!
chat in the morning
Keenan Brock
@kbrock
Dec 09 2015 03:28
but to get real benifit, will have to get rid of find / sql building / AAAR that doesnt' use relations
so have a number of prs on that
night