Optimization of item_history()