When an index is being created on an SQL database-table like Postgres, at the moment of creation the table will be locked. This means writes will be blocked until the index is fully generated.
If you have a write-heavy or big table, one could use the CONCURRENT option in Postgres so that there is no exclusive lock.
Lukas, from a PR review
Creating indexes will lock the table for writes (if not using
CONCURRENToption in Postgres). If you table is big, you might want to avoid this, especially for write-heavy tables.