RE: Database design question
Posted in 1996
> I have a table on a bought-in application with about 350,000 rows. It > has a column defined as an index, but in fact the column contains > contains nothing for any row. Therefore every one of the 350,000 rows > has the same index value, which is clearly undesireable. However, what > the design is clearly meant to achieve is fast selection of a single row > when the column has a non-null value. > > Any hints or tips for this? > > Thanks > > Neil Truby > Chase Bank > Bournemouth, UK Suppose the index is on column col1. Try replacing it with an index on 2 columns (col1, col2). You could then have an index which is more selective but which could still be used in queries where the first index would have been used. When deciding on what extra column to have in your index, consider one that has few duplicate values (or preferably no duplicate values at all), which is narrow (to keep the index size no larger than necessary) and which might be included in the where clause of queries which also include col1. Brian Wilkins IT Technical Support, BCA, Swindon, UK. bew@cix.compulink.co.uk