improve performance for multy id operations