@Override
        public Key createKey(final Key parentKey,
                             final StoredValues storedValues,
                             final ByteBuffer keyBuffer) {
            final int depth = parentKey.getDepth() + 1;
            final boolean grouped = depth <= compiledDepths.getMaxGroupDepth();
            final long timeMs = storedValueKeyFactory.getTimeMs(storedValues);
            if (grouped) {
                final Val[] groupValues = storedValueKeyFactory.getGroupValues(parentKey.getDepth() + 1, storedValues);
                return parentKey.resolve(0, groupValues);

            } else {
                try (final Input input = new ByteBufferInput(keyBuffer.duplicate())) {
                    input.skip(keyBuffer.limit() - Long.BYTES);
                    final long uniqueId = input.readLong();
                    return parentKey.resolve(timeMs, uniqueId);
                }
            }
        }
Creates a nested time based group key. <DEPTH><TIME_MS><PARENT_GROUP_HASH><GROUP_HASH>
stroom-query/stroom-query-common/src/main/java/stroom/query/common/v2/LmdbRowKeyFactoryFactory.java