One more consideration, if your 5mil of records contains duplicates you won't get the opportunity to load the table using "REPLACE" or "INSERT IGNORE" without the UNIQUE index already in place. You would have to distinct the rows first or manually remove the duplicates before creating the index after load. If that's the case it would probably cost you more time.
Ed -----Original Message----- From: Peter J Milanese [mailto:[EMAIL PROTECTED] Subject: RE: SQL and productivity Heh.. I wasn't going by the docs when I responded... I had to reindex a 50+mil row table... Not a good time :) Then I started preparing the structure a bit before taking in the data. Seemed to work better in my circumstance. P -----"Dan Greene" <[EMAIL PROTECTED]> wrote: ----- From: "Dan Greene" <[EMAIL PROTECTED]> Subject: RE: SQL and productivity >From what I've read ( I think in the MySQL docs, might have been here in the list), technically it will take less time to add the indexes after the table creation, than the overhead of index updating per-insert. Either way, it's gonna take a loooooong time. > -----Original Message----- > From: Peter J Milanese [mailto:[EMAIL PROTECTED] > Subject: Re: SQL and productivity > > I'd start with the indexes in place. 5+mil records will take > quite some > time to index after the fact. > > P > > -----Krasimir_Slaveykov <[EMAIL PROTECTED]> wrote: ----- > From: Krasimir_Slaveykov <[EMAIL PROTECTED]> > Subject: SQL and productivity > > Hello , > > I must create a temp table with 5 or more million records. > I need it for creating some reports, so I need to create indexes too. > My question is: > When total time for work will be smaller? : > 1-st case: I create table and create indexes immediately before > filling data. > 2-nd case: I create table, filling data and then create indexes? > -- > Best regards, > Krasimir_Slaveykov > mailto: [EMAIL PROTECTED] [EMAIL PROTECTED] > -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]