commit 14586b2eac909dd76431e4eb9ff00b8f5a4c2d0c
Author: ZhiQiang Fan <email address hidden>
Date: Sat Oct 24 09:30:53 2015 -0600
avoid unnecessary inner join in get_resources() for SQL backend
To get distinct resource ids, we do a query on resource table which
inner join sample table, and apply filters on it.
Note that when sql_expire_samples_only is enabled, there will be
some resources without any sample, in such case we must use inner
join to avoid wrong result, no matter if there is a timestamp filter
or not.
But that option is disabled by default, so when there is no timestamp
filters, the inner join is unnecessary, we should avoid it to save
some RAM/CPU cost.
Change-Id: If85dbea15d42d42c6b0be7402c06f258e278b2eb
Closes-Bug: #1509677
(cherry picked from commit a4f442940551a8a38e26e132c7efa766226daa15)
Reviewed: https:/ /review. openstack. org/242962 /git.openstack. org/cgit/ openstack/ ceilometer/ commit/ ?id=14586b2eac9 09dd76431e4eb9f f00b8f5a4c2d0c
Committed: https:/
Submitter: Jenkins
Branch: stable/kilo
commit 14586b2eac909dd 76431e4eb9ff00b 8f5a4c2d0c
Author: ZhiQiang Fan <email address hidden>
Date: Sat Oct 24 09:30:53 2015 -0600
avoid unnecessary inner join in get_resources() for SQL backend
To get distinct resource ids, we do a query on resource table which
inner join sample table, and apply filters on it.
Note that when sql_expire_ samples_ only is enabled, there will be
some resources without any sample, in such case we must use inner
join to avoid wrong result, no matter if there is a timestamp filter
or not.
But that option is disabled by default, so when there is no timestamp
filters, the inner join is unnecessary, we should avoid it to save
some RAM/CPU cost.
Change-Id: If85dbea15d42d4 2c6b0be7402c06f 258e278b2eb 38e26e132c7efa7 66226daa15)
Closes-Bug: #1509677
(cherry picked from commit a4f442940551a8a