Re: INDEX possible for reverse wildcards?

From: x <x-false_at_yahoo.com>
Date: Mon, 7 Jun 2004 13:06:23 +0300
Message-ID: <40c43d30_at_post.usenet.com>


  • Post for FREE via your newsreader at post.usenet.com ****

"Robert Brown" <robertbrown1971_at_yahoo.com> wrote in message news:240a4d09.0406040759.5e47033f_at_posting.google.com...
> If I use _reverse_ wildcard search will it always result in a table
> scan? Is it possible to get the DB (Oracle or SQL server) to use
> indexes when doing reverse wildcard match?
>
> let's say I have:
>
> table email_address (id int, email varchar)
>
> with the following entries
>
> 2, www.%shoes.%
> 3, w%.super%shoes.%
> 4, %webbox.somecopany.com
>
> select id from email_address where 'www.superdupershoes.com' like
> email;
>
> this returns 2,3
>
> But the query always results in a table scan even if I add an index to
> email. What kind of index can I employ in this situation?
>
>
> Please note that this is a _reverse_ search, the opposite of what's
> normally done, i.e. select from email_address where email like
> 'www.%shoes.com'.

It is possible to define an order on patterns ?

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

  • Usenet.com - The #1 Usenet Newsgroup Service on The Planet! *** http://www.usenet.com Unlimited Download - 19 Seperate Servers - 90,000 groups - Uncensored -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Received on Mon Jun 07 2004 - 12:06:23 CEST

Original text of this message