performance - reduce lock for byId query