I need to insert data and the amount of data is pretty huge. There are some indexes that I need to define on this table. So, my question is…which is better and why
- Create table –> Insert Data –> Create Indexes
- or, Create table –> Create Indexes –> Insert Data
Thnx,
Vabs
choice #1 will be faster because it’s more efficent to build an index from scratch than by adding records one after another. That again is because the records will be sorted beforehand and the index blocks are filled up and written in an ordered manner. In oracle you can also use ´create index … nologging´ to avoid creating the redo log.