|
Posted by Damien on 10/24/06 07:29
jim_geissman@countrywide.com wrote:
> Damien Wrote:
> > I don't believe the optimiser can break down a computed column to know
> > which underlying columns it is based upon. So it doesn't know that the
> > computed column is "covered" by a particular index. Of course, you can
> > index computed columns, and it might then use that index, if it was a
> > covering index.
> >
> > Damien
> How can this be true? In this case, the computed column is simply
> a substring of one of the other columns that is already in the query,
> and is also included in the 3-item index. Is this really too hard for
> the
> optimizer?
>
In the *very specialised* situation where the computed column is the
leftmost n characters, then the index would be usable. But why should
the good people writing the optimizer spend time on that particular
condition? In all other substring situations (where you do not start at
the leftmost character), and for any more complex calculated columns
(remember, they can reference any of the columns), the index would be
useless.
And you always have the option, if you need an index to be considered,
of indexing the computed column.
Damien
Navigation:
[Reply to this message]
|