These are chat archives for ManageIQ/manageiq/performance

20th
Jul 2017
Marcel Hild
@durandom
Jul 20 2017 16:15
@kbrock or any virtual column expert: ManageIQ/manageiq#15614 ?
Keenan Brock
@kbrock
Jul 20 2017 17:36
@durandom the knowledge of whether this is supported comes from ruby right?
There isn't a sql query that can tell you if the feature is supported. right?
Marcel Hild
@durandom
Jul 20 2017 17:36
yes, it's just ruby
Keenan Brock
@kbrock
Jul 20 2017 17:37
why would this be a "virtual" attribute?
Marcel Hild
@durandom
Jul 20 2017 17:37
maybe we should more look at the REST API code and make that query the features though
because it should be queryable through the rest api
see ManageIQ/manageiq#15600
The following API (that used to work before), returns an empty list currently since APIs do not support filtering on non-column methods anymore.
I'm a bit afraid of adding all features as a virtual attribute
Keenan Brock
@kbrock
Jul 20 2017 17:39
yea, and using that to filter (which we expect to be in sql) can get a little hairy
or sort
it would bring back every row to then do a all/nothing filter or sort
Marcel Hild
@durandom
Jul 20 2017 17:40
so you'd change the rest filter to be able to query supports features
Keenan Brock
@kbrock
Jul 20 2017 17:41
yea, special handling of some columns and not others is potentially a problem
also virtual attributes are stored in an array
so making that list too long has some down side
you know, there are libraries that let you remove controllers, so they all act the same and treat all models the same
but it became too tricky, so people went away from the "generic controller"
but I guess this is exactly what the rest api is :(
anyway
yea, 15600 isn't so hot. thanks
Marcel Hild
@durandom
Jul 20 2017 17:44
:fire:
Keenan Brock
@kbrock
Jul 20 2017 17:45
omg
so "supports :foo" is defined in a subclass?
Marcel Hild
@durandom
Jul 20 2017 17:46
@kbrock yes, and might be diffrent in a base class
but dont look further
Keenan Brock
@kbrock
Jul 20 2017 17:46
ok, so performance wise
you have to convert every class into a ruby object to ask
Marcel Hild
@durandom
Jul 20 2017 17:46
i guess we dont go the virtual attr rout
Keenan Brock
@kbrock
Jul 20 2017 17:47
so you can't do anything in sql, you have to take every record into memory
if you return the attribute, then life is good (I guess)
if you filter, sort, ... you have to download load everything into memory, filter, then return the 20 records (pagination)
every time
omg I hate STI
@durandom yea in general, you can't do anything here. The way this feature is written is probably going to put us into a difficult position performance wise
Nick LaMuro
@NickLaMuro
Jul 20 2017 17:57
I think we would have to do some hoop jumping to make this work in SQL. We could effectively keep an array in memory of every class type that equals true for supports_x, and then the query is simple and then can be done in arel.
the problem with that is looking long term, that really isn't something we can scale out easily in a micro-services architecture
(I condensed a lot of my thoughts on this down, so let me know if that needs a further explaination)
Keenan Brock
@kbrock
Jul 20 2017 18:01
@NickLaMuro nope - that sounds right