This cuts the time required to import 38000 messages (with 140000 message receipts) from about 10 minutes to just under 40 seconds on my laptop with sqlite. (imported from commit d53b0d1360408c77f38353b58fbb25875262cb40)