spree/spree — pull request #5730 by BenMorganIO (2014-12-09 02:06:15+00:00)
Title: Faster states and countries

In PR #5477 we were able to increase the seed database dramatically by using Carmen. In doing so, we end up adding a _lot_ of data for an initial seed. Quite often, it would take ~1-2 seconds to add the countries and about ~14-16 seconds to add the states.

This PR is to help fix that issue. I noted that it would take about 2 seconds for the states to be added via a mass insert. Guess what: it now takes ~1 second to add 3 thousand rows.

While making the code for states, I decided to do a test run with a small amount of data (the countries) and was able to round down what would take (for me) 1.2 seconds down to 0.1 seconds.

If this PR is acceptable, I'll add a `when` for `"MySQL"` and get some performance in over there when seeding.