def clear_past_results(self, start, end):
        """Removes records from hits_mv and main_crawlaggregates tables matching
        the given time period.

        """
        for table in ['hits_mv', 'main_crawlagregates']:
            st = time.time()
            self.log.info('Deleting rows from {0} where start_time between {1}'
                ' and {2}.'.format(table, start, end))
            q = "DELETE FROM {0} where start_time BETWEEN '{1}' AND '{2}';"
            execute_sql(q.format(table, start, end), commit=True)
            self.log.info('{0}s elapsed.'.format(time.time() - st))
dataset/ETHPy150Open ipeirotis/Mturk-Tracker/app/mturk/updaters/management/commands/recalculate_aggregates.py/Command.clear_past_results/original