To your point, though (the reason I started writing this email):
there's not
too much motivation for implementors to try to detect and optimize
this kind
of edge case, because nobody should be writing a query in the
second form :)
There are reasons for wanting to see all strings that start a
particular way...
I was actually referring to the "regex identical to a string match"
problem, which I think the original mail intended: it's not really
worth adding an optimization check for regex(... "^foo$"), because the
user really shouldn't write that! I agree with you abuot prefix search.
One thing I've experimented with is detecting some kinds of regexes
and
compiling them into free-text index operations. That's likely a
middle
ground.
I've considered the same, but so far I've been of the opinion that
there are a lot of other areas I need to improve performance in first.
:-)
Heh, ain't that always the way? :)