Optimized context menu DB operations for speed.