The code to generate unique numeric ids MongoDBDialect#nextValue is always issues at least two RPCs. It could benefit from initializing the initial values of each sequence upfront, probably at schema generation; if we know the initial value is written, we can issue only the update increment RPC. |