Re: SE: is it useful to build an index over a serial field?
Posted in 2004
Peter Michel wrote: > i have a performance question about a table with one serial field. > The serial starts at 1 by 1 and i will access the rows via this serial > field. Like rowid, where is no index, can i access via the serial > field in the same manner under same performance or is it useful to > create an index with this serial field? The index is useful. SE knows that ROWID values can't have holes in the sequence; it doesn't with a SERIAL column. So, it will either auto-index or sequential scan if you search by serial column, neither of which is conducive to good performance. Remember, someone might delete some rows from your table, and then there's no guarantee that the serial numbers are still in physical order. -- Jonathan Leffler #include <disclaimer.h> Email: jleffler@earthlink.net, jleffler@us.ibm.com Guardian of DBD::Informix v2003.04 -- http://dbi.perl.org/