I have a situation where I need to create a table in Postgres and add approximately 3 million rows. Currently I am adding an index to one field after all the data is loaded, but I was wondering whether adding an index before loading the data (at the time the table is created) is better, worse, or neutral.
What is considered best practice for when indexes should be added to tables in Postgres? Does Postgres pause indexing during transactions?