Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Helping a Buddy find an answer
Message
De
22/11/1999 13:26:16
 
 
À
22/11/1999 13:17:32
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Divers
Thread ID:
00293895
Message ID:
00294003
Vues:
37
>Doug,
>
>Quite nice of you to help out a friend.
>
>SQL Server uses a cost based optimizer. When it is evaluating the query, it will determine how useful an index is. It does this by looking at some statistics that describe the distribution of the data within the index. If SQL Server determines that it is more work to use the index than do a table scan, it will do the table scan.
>
>An eash way to see this is for your friend to run the following queries:
>
>SET STATISTICS IO ON
>SELECT * FROM appl WHERE name_licensee LIKE 'tab%'
>SELECT * FROM appl WITH INDEX() WHERE name_licensee LIKE 'tab%'
>SET STATISTICS IO OFF
>
>Where is the name of the index on the name_licensee column.
>
>The WITH INDEX() is an optimizer hint. With it, I forcing the optimizer to use the specified index. We're interested in the Logical Page count. If the first query has a smaller value, SQL Server is solving the query in the best possible way. If the second query has a smaller value...
>
>Now, why your friend is seeing this results is a different matter. Maybe the statistics are not to date. SQL Server does maintain the statistics, but only when it determines that enough changes have been made to the table.
>
>I'd also like to suggest a book: Inside SQL Server 7.0 by Delaney.
>
>-Mike
Mike,

Thank you thank you thank you! *g*

I'll send this on to Mark. He and I worked on an interesting project at www.eccompany.com a few years back. A FoxPro based EDI/ACH project.

The whole notion of helping a friend IMO is the basis of what makes the FoxPro community tick.

Best,

DD
Best,


DD

A man is no fool who gives up that which he cannot keep for that which he cannot lose.
Everything I don't understand must be easy!
The difficulty of any task is measured by the capacity of the agent performing the work.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform