Informix Optimizer Question
Posted in 1997
I wonder if one or more people who are familiar with the Informix Optimizer could comment on my statements below (I'm trying to generalize these statements to apply to any of the big RDBMS's). Are these statements essentially valid for Informix? Indexes that do not signficantly improve performance of important transctions should be avoided. To help identify non essential indexes, consider the following: ' the database will not always use an index, especially if it has a better index available. For example, consider what happens when the user provides two values for a search and both these columns are indexed. If one of the indexed columns is near unique, the database will probably only use the near unique column index to perform its search. ' if the table has a small number of rows, the database will often find it faster to simply scan the entire table and not bother using the index. The exact number of rows where an index is unnecessary varies by database product and the number of table columns but the cutoff is usually somewhere in the 100-500 row range. ' Indexing columns that can take on a small number of evenly distributed values will not help the database when searching. The rule of thumb is that an index will only help the database if it eliminates at least 90% of the result set. An evenly distributed Yes/No flag is an example of a poor index since it eliminates only 50% of the result set, on average. The database would not use such an index because it is faster for the database to simply scan all the rows. P.S. if you notice any significant omissions, I'd appreciate feedback on that too.