begin; truncate air_temperature_map; drop index air_temperature_map__report_time_stamp; drop index air_temperature_map__report_time_stamp_z; insert into air_temperature_map ( station_id, time_stamp, z, label_z, temperature_celcius, temperature_fahrenheit, lon, lat, report_time_stamp, the_geom, value_temperature_celcius, value_temperature_fahrenheit ) select station_id, time_stamp, z, label_z, temperature_celcius, temperature_fahrenheit, lon, lat, report_time_stamp, the_geom, value_temperature_celcius, value_temperature_fahrenheit from air_temperature_prod where top_of_hour = 1; -- -- indexes -- create index air_temperature_map__report_time_stamp on air_temperature_map(report_time_stamp); create index air_temperature_map__report_time_stamp_z on air_temperature_map(report_time_stamp,label_z); end;