Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Select Question
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00271745
Message ID:
00271751
Vues:
17
Hi Paul,

My guess is it's the AND that's slowing it down. If you changed your condition to:

TTK_KEYWORD + ttk_type = 'APPLEM'

You should get fast results, because your expression now matches the key.
(Of course, you may have to pad 'APPLE' to the field length of ttk_keyword)

HTH!
Mark


>I have a select statement that I am pretty sure is not being optimized correctly.
>
>I have a table with 200,000 records and when I issue the following select statements they both take the same amount of time.
>
>**************************
>SELECT * FROM SCTTKW WHERE at('APPLE',ttk_keyword) > 0 and at('M',ttk_type) > 0
>***************************
>
>Now, with the statement above I would think would have to go through every record to see if 'APPLE' exists anywhere within the field ttk_keyword.
>
>*********************
>SELECT * FROM SCTTKW WHERE TTK_KEYWORD = 'APPLE' and ttk_type = 'M'
>*********************
>
>I have 10 records within the 200,000 where ttk_keyword is 'APPLE' and ttk_type = 'M'. I have an index set up which is "ttk_keyword+ttk_type".
>
>I would think that this statement should be able to "jump" to the first record that has 'APPLE' and then quit after the last record that has apple. But this statement isn't any faster than the previous one.
>
>Am I doing something wrong?
>
>Thanks,
>Paul
"It hit an iceberg and it sank. Get over it."
Robert Ballard, dicoverer of the Titanic wreckage.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform