use concurrency while creating indexes in postgresql code example
Example: create index concurrently postgres
create index concurrently [index_name] on [table_name]([column_name]);
create index concurrently [index_name] on [table_name]([column_name]);