Mass Insert before or after Index creation?
Posted in 2000
Topics: General Discussion
Hello, Simple Newbie Question: Is it more performant to create Indices after or before inserting many rows into a table? My personal brain sais, its better to create Indexes after the mass insert because then they are built "en block". Is this right? Or is there another factor I don't know? -- MfG, Erhard Schwenk
Your better off creating the Index after loading the data unless you need to enforce UNIQUE/DISTINCT during the load. This will reduce the amount of work the system does during the load (index building is faster then index inserts) and give you a more compact index. S.W. swilcoxon@iqmktg.com "Erhard Schwenk" <eschwenk@fto.de> wrote in message news:39EB14C3.8E1EEFAA@fto.de... > Hello, > > Simple Newbie Question: > Is it more performant to create Indices after or before inserting many > rows into a table? My personal brain sais, its better to create Indexes > after the mass insert because then they are built "en block". Is this > right? Or is there another factor I don't know? > > -- > MfG, Erhard Schwenk
"Steven Wilcoxon" <swilcoxon@iqmktg.com> writes: > Your better off creating the Index after loading the data unless you need to > enforce UNIQUE/DISTINCT during the load. This will reduce the amount of work > the system does during the load (index building is faster then index > inserts) and give you a more compact index. And you can tune your engine for load first and index creation later -should be mucho faster... Thomas