*** spatel has joined #openstack-placement | 01:01 | |
*** spatel has quit IRC | 03:17 | |
*** openstackgerrit has joined #openstack-placement | 04:12 | |
openstackgerrit | melanie witt proposed openstack/placement master: Add consumer_types migration, database and object changes https://review.opendev.org/669170 | 04:12 |
---|---|---|
openstackgerrit | melanie witt proposed openstack/placement master: Microversion 1.37: API support for consumer types https://review.opendev.org/679441 | 04:12 |
openstackgerrit | melanie witt proposed openstack/placement master: Switch ConsumerType to use an AttributeCache https://review.opendev.org/679486 | 04:12 |
*** evrardjp has quit IRC | 05:34 | |
*** evrardjp has joined #openstack-placement | 05:34 | |
*** tetsuro has joined #openstack-placement | 07:22 | |
*** tetsuro has quit IRC | 07:23 | |
*** martinkennelly has joined #openstack-placement | 09:31 | |
*** belmoreira has quit IRC | 10:46 | |
*** N3l1x has joined #openstack-placement | 11:09 | |
*** cdent has joined #openstack-placement | 12:42 | |
*** tetsuro has joined #openstack-placement | 12:42 | |
*** cdent has quit IRC | 12:54 | |
*** tetsuro has quit IRC | 14:04 | |
*** martinkennelly has quit IRC | 15:39 | |
melwitt | zzzeek: 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@145 | 15:46 |
zzzeek | melwitt: 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 BY | 15:52 |
zzzeek | count() 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 rows | 15:52 |
melwitt | zzzeek: 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 |
zzzeek | melwitt: just don't include those other columns in the columns clause | 15:56 |
zzzeek | it looks like you are only reading the "count" part | 15:56 |
zzzeek | so just say, "SELECT count(DISTINCT z) FROM table" | 15:56 |
melwitt | zzzeek: 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 realizing | 15:58 |
zzzeek | melwitt: yes do that :) | 15:58 |
zzzeek | melwitt: 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 so | 15:59 |
melwitt | haha ok, thanks. that would make this a lot less weird | 15:59 |
zzzeek | yes | 15:59 |
melwitt | zzzeek: thanks a lot for the help. I'll reapproach it as completely different queries in both cases | 16:04 |
*** cdent has joined #openstack-placement | 16:06 | |
*** N3l1x has quit IRC | 16:14 | |
efried | a solution above reproach. | 16:16 |
*** martinkennelly has joined #openstack-placement | 16:50 | |
*** martinkennelly has quit IRC | 16:56 | |
*** cdent has quit IRC | 17:31 | |
*** evrardjp has quit IRC | 17:34 | |
*** evrardjp has joined #openstack-placement | 17:34 | |
*** spatel has joined #openstack-placement | 23:58 |
Generated by irclog2html.py 2.15.3 by Marius Gedminas - find it at mg.pov.lt!