Re: Problem with performance!
Posted in 1998
In article <351aa887.10429691@nntp.ix.netcom.com>, Joe Vigil
<avimis@ix.netcom.com> writes
>On our system,
> SELECT * FROM tablex WHERE field1 MATCHES '[K,k][O,o][P,p]*'>took 45 seconds to run
Because it does not use an index.
>when I changed it to
>SELECT * FROM tablex WHERE field1 MATCHES 'K[O,o][P,p]*'
>union
>SELECT * FROM tablex WHERE field1 MATCHES 'k[O,o][P,p]*'>
Because it would use an index to match the first letter.
Store a second version of the field in uppercase and search
on that..
>it took 1 second...
>
>
>On Thu, 19 Mar 1998 14:58:11 +0100, marko kopac <marko.kopac@mais.si>
>wrote:
>
>>Hello!
>>
>>Could anybody help me!!!
>>
>>How to make my SQL quicker: SELECT * FROM tablex WHERE field1 MATCHES
>>'[K,k][O,o][P,p]*'
>>
>>Index is made by field1, table contains 34500 records, sql working 30
>>seconds. Is that normal?
>>
>>
>>Marko
>>
>
--
David Williams
Maintainer of the Informix FAQ
Primary site (Beta Version) http://www.smooth1.demon.co.uk
Official site http://www.iiug.org/techinfo/faq/faq_top.html
I see you standin', Standin' on your own, It's such a lonely place for you, For
you to be If you need a shoulder, Or if you need a friend, I'll be here
standing, Until the bitter end...
So don't chastise me Or think I, I mean you harm...
All I ever wanted Was for you To know that I care