Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to speed up SQL remote view ?
Message
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00572419
Message ID:
00574454
Vues:
56
*snip*
>Conclusion: Every table in SQL Server should have a clustered index. In the absence of knowing which key to choose, you then go with the PK.
>

John,
I disagree with this entirely. IMO, clustered indexes are created with a purpose. If no purpose exists then creating one is superfluous.

Clustered indexes physically order the table. The reason for them IMO, is to create blocks of data. Returning the least amount of pages of data is key to performance. If the data you are returning is ordered so tht the block(s) you need are located on a single page or consecutive pages, BINGO! Your job is done.

However, if your queries are going to be drawing data from all over the table, a clustered index is not necessary. And in fact, if you base a clustered index on an auto incrementing, surrogate key, in essence you get the same ordering as if you had no clustered index at all. The table is still ordered in the order in which the row was added to the table. What benefit is there? An index scan of a clustered index based on this is no better than a table scan (it's the same).

No, my conclusion is a bit different.

Design your clustered indexes around your queries. If this is not possible for whatever reason (e.g. CRUD operation performance), don't use them.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform