Re: sql query not use index

From: Maxim Demenko <>
Date: Mon, 09 Mar 2009 20:42:39 +0100
Message-ID: <> schrieb:
> Hello Guys,
> I was asked yesterday a project manager what sort of query will not
> use an index?
> What sort of index ? I asked
> say a varchar(256) ?
> A badly written regex. I responded.
> OK thanks.
> Now I am worried I have given a misleading or wrong response!
> Can anyone help me out with a better answer?
> Syd

I'm afraid, this question can't be answered (in sense - there is such sort of queries) in general case - in opposite, i can imagine, every query can be forced to use an index ( it may be of course not the optimal access path), provided an appropriated index inplace. Popular rules of thumbs ( null values are not indexed, selectivity is more than 10%, etc) don't count, because under certain conditions they are not valid. Your project manager may be interested in selfeducating at least on

The badly (whatever it supposed to be) written regular expression can perfectly be applied to an index as rowsource...

Best regards

Maxim Received on Mon Mar 09 2009 - 14:42:39 CDT

Original text of this message