[openstack-dev] [Ceilometer] SQL meter table schema improvements
Jay Pipes
jaypipes at gmail.com
Wed Aug 14 17:20:47 UTC 2013
On 08/14/2013 12:52 PM, Julien Danjou wrote:
> On Wed, Aug 14 2013, Jay Pipes wrote:
>
>> I submitted a bug report to improve the schema of the meter table to reduce
>> duplication:
>>
>> https://bugs.launchpad.net/ceilometer/+bug/1211985
>>
>> This would only affect the SQL storage driver.
>>
>> Interested in hearing thoughts on the above recommendations, which are:
>>
>> 1) Replace counter_type with an integer column counter_type_id that
>> references a lookup table (counter_type)
>> 2) Replace counter_unit with an integer column counter_unit_id that
>> references a lookup table (counter_unit)
>> 3) Replace counter_name with an integer column counter_id that references a
>> lookup table (counter)
>>
>> Just those three changes would reduce the overall row size for records in
>> the meter table by about 10%, by my calculations, which is a good
>> improvement for a relatively painless set of modifications.
>
> That means we'll have to do 3 joins most of the time. Is that less
> costly than fetching these right away from the record?
Yes, much less costly.
With the joins, you are only searching/fetching the long string once.
With the long strings in the meter table, you are
searching/fetching/storing those long strings thousands and thousands of
times, instead of a small integer lookup key.
RDBMS were built for relational data like this, and joins are a faster
solution in RDBMS compared to flat schemas like No-SQL data stores require.
Best,
-jay
More information about the OpenStack-dev
mailing list