One easy way to fix this, it could be, that the traders reuse their own ItemIDs from the Items they didn't sell, and only create new ItemIDs if they sold Items. But that change has to do in the main exe file (not in the savegames). That change will reduce 82% the creation of ItemIDs.