marius00 / iagd

MIT License
104 stars 31 forks source link

Defer creation of indexes for item tables until after all of the records have been imported #184

Closed tansheron closed 1 year ago

tansheron commented 1 year ago

When the GD database is loaded, the loader drops and recreates the indexes on the item tables after every batch of items is created. There is no obvious reason to do this and it adds about 50 seconds to the total database-loading time on my machine. This PR makes the loader create the indexes only once after all of the items have been inserted. Since the indexes still take a few seconds to create, it adds an "Indexing items" progress bar to the loader's dialog to make it clear that loading has not stalled.

This PR has been tested with SQLite but not Postgres.

marius00 commented 1 year ago

Great work, merged them both.

Out of curiosity, what are you working on?

tansheron commented 1 year ago

Unfortunately, I'm not ready to share the details yet. I don't want anyone to wonder what happened if the project is never released after being revealed. All I'm comfortable with mentioning is that it uses parts of the Parser project to help read the game's archive and character files.