> Nice One,
> It's not the first time I've met this problem.
> We tried on a development box - 170K rows - took about a minute.
> Few questions
> Didn't drop the index - any risk there ?
> The conversion to integer was virtually instantaneous - does this
> simply involve changing a system table ?
> The conversion to serial was more time consuming - was it recreating > the maximum serial ?
> Any need to lock the table or stop logging ?
> The target table has around 14 Million rows and as we would like to
> keep any outage to a minimum we would rather avoid dropping and
> recreating the index if that is safe.
You don't have to drop/recreate the index.
It is faster to drop and recreate it.
The conversion is very easy. serial is an int8 datatype, so no conversion needed. Informix just creates a new version of the table to have the least downtime as possible. Once you have lots of time you could reset the table to version 1, but that might take some time.
The conversion to serial was more time consuming because he had to check for any duplicates. So once you converted to integer, recreate the index and than convert back to serial.
Just make sure you don't create a long transaction. That might be a disaster. make sure you have enough log space, or just tur off logging (not really the best solution).
Anyway, goodluck!