Optimize affected_visualization retrieval