MySQL indexes

Hi!

I have a question regaring indexes in MySQL.

When I insert data I have read that is good to turn them off

But is that still ok if I have records that already exists in the database that i'm going to insert agan.

I use the On Duplicate Insert so is it still ok then even if I turn the indexes off?

And how do I turn it off? do I need to do something more then turn it off and then on again. do I need to do any optimize,flush etc?
LVL 1
AWestEngAsked:
Who is Participating?
 
Guy Hengel [angelIII / a3]Connect With a Mentor Billing EngineerCommented:
>When I insert data I have read that is good to turn them off
if you "BULK" insert alot of rows, yes. not when you insert few/single rows.


>I use the On Duplicate Insert so is it still ok then even if I turn the indexes off?
as this is mostly used when doing single inserts, you really should keep the indexes in place.

you cannot "turn" an index of in MySQL, you have to drop the index.
0
 
AWestEngAuthor Commented:
oki.  I insert about 8000 rows.. but I still should keep it on then?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.