Use direct SQL for performance