[openstack-dev] [Ceilometer] Question about get_meters query using a JOIN

Julien Danjou julien at danjou.info
Wed Aug 14 08:26:22 UTC 2013

On Tue, Aug 13 2013, Thomas Maddox wrote:

> I was curious about why we went for a JOIN here rather than just using the
> meter table initially?
> https://github.com/openstack/ceilometer/blob/master/ceilometer/storage/impl_sqlalchemy.py#L336-L391.
> Doug had mentioned that some performance testing had gone on with some of
> these queries, so before writing up requests to change this to the meter
> table only, I wanted to see if this was a result of that performance
> testing? Like the JOIN was less expensive than a DISTINCT.

Because the SQL driver has been historically a straight conversion from
MongoDB, who was working that way.
The MongoDB driver had these 2 collections, meter and resources, and
used both of them to construct these data.

The original idea was to register resources in the eponym table, and use
it to filter. Unfortunately, that didn't work out, especially with APIv2
that allows to filter on many things. Among other things, there was
timestamp fields in the resource table that were used to filter based on
timestamp, but this was a naive implementation that failed pretty soon,
and we removed and replace with a more solid one based on the meter

What you see here are the rest of that time, and in the end, this
resource table should be removed AFAICT, in MongoDB also.

Julien Danjou
;; Free Software hacker ; freelance consultant
;; http://julien.danjou.info
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20130814/ab841857/attachment.pgp>

More information about the OpenStack-dev mailing list