regen-network / indexer

:rocket: Blockchain indexer and database
Other
2 stars 0 forks source link

Make this index creation idempotent in context of newly added run_all_migrations script #21

Closed wgwz closed 1 year ago

wgwz commented 1 year ago

When I was running the run_all_migrations.sh against production it was hanging for a long time. This is because of this LOC which creates an expensive index: https://github.com/regen-network/indexer/blob/main/sql/V1__init.sql#L38 This SQL line could be adjusted to be idempotent using an if not exists syntax. Additionally, this task should check that there are no other expensive non-idempotent operations in the SQL files. We should also a note about this into the sql/README.md i.e. "please only make use of idempotent operations"

ryanchristo commented 1 year ago

Closing in favor of #25.