[Zope] newbie - odbc missing operator
Phillip J. Eby
pje@telecommunity.com
Mon, 16 Aug 1999 18:15:57 -0500
At 07:03 PM 8/16/99 -0400, Rob Page wrote:
>
>If there are one or more areacodes in the list it will render something
>like:
>
>SELECT stuff FROM contact
>where
> phone LIKE '(540)%' OR
> phone LIKE '(703)%' OR
> phone LIKE '(813)%'
>
>or at least it looks like it should! :^)
>
>I think this would be REALLY slow.
>
Depends on the backend. Sybase handles this blindingly quickly. I know
because IDS' e-mail portal builds an OR list like this for every word in
the subject line of an e-mail to match against a table to see if it
recognizes the word as a domain name we host. The table it scans holds
about 200,000 domain names, and almost 1 million records total, but the
queries execute in a couple seconds, tops. The field is indexed, but it
only holds 24 characters and the domain names can be longer. So on any
word longer than a certain number of characters, we have to do a wildcard
search. (Don't ask.) Anyway, Sybase and many other databases recognize
that they can use indexes to speed queries of the form "LIKE 'xxx%'". So
the above query will execute as quickly on such databases as an '=' or
'IN'-based query.