I would consider 40 mb to be pretty large for a .indd in most cases, so I expect there was a lot of crud that was removed by the save as.
I'm sure this must have been discussed before, but what actually is that crud, why is InDesign particularly effected by its build-up, and why is fixing it not a priority?
I routinely use a 'save as same name' script to clean up my files, but I can't seem to find where I got it from.
Many applications do a "fast save". This includes Acrobat and Word for example. The quick save writes new stuff to the end of the file, making the file larger every time even if you delete things. Some apps use "Save as" to go through and do a slower save of only the things still used. I don;t actually know if InDesign works this way but it's quite likely. Fast save also has the advantage that it's much less likely to corrupt the file you are overwriting.