Friday, 2020-02-14

*** spatel has joined #openstack-placement01:01
*** spatel has quit IRC03:17
*** openstackgerrit has joined #openstack-placement04:12
openstackgerritmelanie witt proposed openstack/placement master: Add consumer_types migration, database and object changes  https://review.opendev.org/66917004:12
openstackgerritmelanie witt proposed openstack/placement master: Microversion 1.37: API support for consumer types  https://review.opendev.org/67944104:12
openstackgerritmelanie witt proposed openstack/placement master: Switch ConsumerType to use an AttributeCache  https://review.opendev.org/67948604:12
*** evrardjp has quit IRC05:34
*** evrardjp has joined #openstack-placement05:34
*** tetsuro has joined #openstack-placement07:22
*** tetsuro has quit IRC07:23
*** martinkennelly has joined #openstack-placement09:31
*** belmoreira has quit IRC10:46
*** N3l1x has joined #openstack-placement11:09
*** cdent has joined #openstack-placement12:42
*** tetsuro has joined #openstack-placement12:42
*** cdent has quit IRC12:54
*** tetsuro has quit IRC14:04
*** martinkennelly has quit IRC15:39
melwittzzzeek: hey, I wrote some potentially terrible sqla yesterday and would greatly appreciate your input on how to improve it https://review.opendev.org/#/c/669170/12/placement/objects/usage.py@92 and https://review.opendev.org/#/c/669170/12/placement/objects/usage.py@14515:46
zzzeekmelwitt: my first impression is that it's not generally valid SQL to have a query like, "SELECT colx, coly, count(colz) FROM table" without a GROUP BY15:52
zzzeekcount() is an aggregate that suggests multiple rows have to be rolled up.  so if colx / coly aren't unique within that being rolled up in colz, the database has to implicitly lose rows15:52
melwittzzzeek: hm ... I definitely don't want to group it by resource class because that "splits" the count over multiple rows and I don't want that. let me think about what it should group by (sorry I'm really bad at this)15:56
zzzeekmelwitt: just don't include those other columns in the columns clause15:56
zzzeekit looks like you are only reading the "count" part15:56
zzzeekso just say, "SELECT count(DISTINCT z) FROM table"15:56
melwittzzzeek: I was trying to do something like an intermediate query because the query on L93-99 does use the other columns. are you saying it would be better to simply completely separate them into two different things? I think that's what I'm realizing15:58
zzzeekmelwitt: yes do that :)15:58
zzzeekmelwitt: the Query has ways of changing the columns you are asking for but I didn't do a good job with those APIs, there's a rework coming up in a year or so15:59
melwitthaha ok, thanks. that would make this a lot less weird15:59
zzzeekyes15:59
melwittzzzeek: thanks a lot for the help. I'll reapproach it as completely different queries in both cases16:04
*** cdent has joined #openstack-placement16:06
*** N3l1x has quit IRC16:14
efrieda solution above reproach.16:16
*** martinkennelly has joined #openstack-placement16:50
*** martinkennelly has quit IRC16:56
*** cdent has quit IRC17:31
*** evrardjp has quit IRC17:34
*** evrardjp has joined #openstack-placement17:34
*** spatel has joined #openstack-placement23:58

Generated by irclog2html.py 2.15.3 by Marius Gedminas - find it at mg.pov.lt!