Hi @MaBeuLux88_xxx and others,

I have to come back to this issue because it looks like my observation was not accidental. To proof my observation I now did a dedicted test with the following test steps

  1. export (mongoexport) sample data of 100.000 documents out of some test environment (documents have MongoDB ObjectIds included)
  2. import (mongoimport) these data to a fresh MongoDB 4.2.22 and a fresh Mongo 5.0.11 database
  3. compare the collection statistics

Test-Result:

  • same avgObjSize of 495 bytes in MongDB 4 and 5
  • different avgIndex Size of _id-Index
    • MongoDB 4 → 10 bytes
    • MongoDB 5 → 19 bytes

Do you know what causes this difference? I can provide the test data and also the collection stats() reports if you would like to reproduce the behaviour.

Kind regards
Franz


Test environment

  • Windows
  • MongoDB 4.2.22 / 5.0.11

MongoDB Configuration

# mongod.conf

# for documentation of all options, see:
#   http://docs.mongodb.org/manual/reference/configuration-options/

# Where and how to store data.
storage:
  dbPath: c:\Progs\mongodb-win32-x86_64-2012plus-4.2.22\data\
  journal:
    enabled: true

# where to write logging data.
systemLog:
  destination: file
  logAppend: true
  path:  c:\Progs\mongodb-win32-x86_64-2012plus-4.2.22\log\mongod.log

# network interfaces
net:
  port: 27020
  bindIp: 127.0.0.1