• I really like this kind of questions 🙂

    ...but the question has a minor issue. When I created the QOD database with the DemoTable table and tried to rebuild the index, I got the following error message:

    The statement has been terminated.

    Msg 1101, Level 17, State 12, Line 1

    Could not allocate a new page for database 'QOD' because of insufficient disk space in filegroup 'PRIMARY'. Create the necessary space by dropping objects in the filegroup, adding additional files to the filegroup, or setting autogrowth on for existing files in the filegroup.

    PS. When I was calculating the size of the upper levels of the index, I stubbornly divided the number of rows by 426, not the number of leaf pages.

    1,000,000 / 426 = 2348

    2348 / 426 = 6

    6 / 426 = 1

    2348 + 6 + 1 = 2355

    "Why there's no such answer as 202356?" – that was a sore subject for me for at least 20 minutes 😀