Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Question on table indexes
Message
De
22/12/1999 03:12:28
Walter Meester
HoogkarspelPays-Bas
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00306942
Message ID:
00307170
Vues:
20
>The DBMS language I had used for DOS had a limitation on the number of indexes we could have so I am very accustomed to making compound indexes involving many fields.
>
>As I am becoming more familiar with the way VFP and Rushmore works I am beginning to wonder if it isn't better to create most of my indexes based on one field.
>
>The only down side I see to doing this is that I wouldn't be able to use seek statements if my search criteria involves more than one field. But then I guess I could use a locate for with multiple indexes.
>
>I know there would be exceptions to the rules where I would want more than one field in an index...But, I am just curious on how some of you set up your indexes.

This is a difficult topic. Personally, I use indexes on one field in most cases. Only in cases where I want to use the xBase approach of setting RELATIONS I might choose for composite indexes (as I choose for intelligent PKs and not generated). Mostly this is the case when I want to make large reports where in the resultset of the SQL - Select command there a few foreign keys whereof I want to have more information.

I tend to use as less indexes as possible. I start with only adding indexes for:
- enforcing uniqueness constraints (primary and candidate keys)
- Referential Integrity (RI) where the foreign keys need to be indexed also.
- Obvious very important fields of which can be determined at forehand an index would be required

In the development of the product you might discover some performance problems within speficific parts of the application I try to discover where it comes from and first try to determin of it can be solved another way (maybe a xBase trick) and if not, add another index wich solves the preformance problems.

I use a less indexes for the following reason:
- The might speedup things, but could also be a burden to others because when adding or replacing records the index has to be updated.
- Especially in the past FPW/FPD 2.6 Indexes tend to get corrupt from time to time which can cause nasty and unpredictable results.

walter,
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform