3 ms·
Could you also mention what is the appropriate way to go about it?
by watt 2y ago
Could you also mention what is the appropriate way to go about it?
- keeperofdakeys 2y agoEither put machinery in your schema migration tool to create indexes as a separate step, so they are easy to re-apply. This makes keeping indexes in sync between production and staging a lot easier. Or you can use "CREATE TABLE_B (LIKE TABLE_A WITH INDEXES);".
- kroolik 2y agoMake sure to create indices AFTER the data is in. Its way faster to create indices from data than create them empty and insert data. Also make sure to set maintenance_work_mem high as it helps with index creation