Inserting records for daily aggregation projections

Perform the following steps to insert records into the reporting database. The code in this procedure is for demonstration purposes only. This example assumes that two data centers (Austin and Bangalore) already defined and the metrics you want to filter on are called analytics_test1 and analytics_test2.
  1. Log in to the Analytics reporting database as the root user or a user with administrative permissions.
    mysql -u root reporting
  2. Enter the following command at the prompt substituting values that apply to your company's situation:
    insert into projection_config
       (name, days_past, days_future, agg_column_name)
    values
       ('austin_60_30', 60, 30, 'fct_avg'),
       ('bangalore_60_30', 60, 30, 'fct_avg'),
       
    insert into projection_business_hours_assoc
       (projection_config_id, business_hours_config_id)
    values
       (
          (select id from projection_config where name='austin_60_30'),
          (select id from business_hours_config where name='austin')
       ),
       (
          (select id from projection_config where name='bangalore_60_30'),
          (select id from business_hours_config where name='bangalore')
       );
      
    insert into projection_group_assoc
       (projection_config_id, group_filter_id)
    values
       (
          (select id from projection_config where name='austin_60_30'),
          (select id from group_filter where name='austin')
       ),
       (
          (select id from projection_config where name='bangalore_60_30'),
          (select id from group_filter where name='bangalore')
       );
       
    insert into projection_metric_assoc
       (projection_config_id, metric_key)
    values
       (
          (select id from projection_config where name='austin_60_30'),
          (select metric_key from meta_metric where metric_name='analytics_test1')
       ),
       (
          (select id from projection_config where name='austin_60_30'),
          (select metric_key from meta_metric where metric_name='analytics_test2')
       ),
       (
          (select id from projection_config where name='bangalore_60_30'),
          (select metric_key from meta_metric where metric_name='analytics_test1')
       ),
       (
          (select id from projection_config where name='bangalore_60_30'),
          (select metric_key from meta_metric where metric_name='analytics_test2')
       );