Reduce queries involved in import cronjob.