views:

25

answers:

2

I have some data in my production database already. If I'm adding some database indexes on a few fields, is that a problem?

Rails 2.3.5, Ruby 1.8.7, sqlite3 database

+2  A: 

No, that's not a problem. On some implementation of indexes I know of, the B-Tree actually will be brand new trees in the database (as pages), and so it won't affect the new tree to have fragmentation. Just that building the indexes may take some time depending on how much data is in the DB.

動靜能量
A: 

You can, but adding indexes cause temporary blocking tables.

xt.and.r