Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Index on integer & date fields
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00229164
Message ID:
00229189
Vues:
18
Jane,
If you're writing a textbook example for an article on data normalization, then repeating a field is a no-no. However, if you're trying to provide useful, convenient real-world solutions, then often repeating a field is a yes-yes :-)

In this case, you SHOULD repeat the Table1 field in Table3, so you can index and show data quickly. We do it all the time on our big apps. Joining 3 tables to show a field that could be added to the grandchild (Table3) table and eliminate the necessity for the join a thousand times per day is only sensible.

HTH
Barbara

>The table2 interfield is in table 3 but table 2 has the integer field that's in table 1. I want to index on a table1 value. Can I say index on str(table1.id) + DTOS(table3.date)? What I'm trying to do is avoid dups in table 3 - the dups are based on a table 1 field & a table 3 field. Perhaps I have to do this another way. Would a view help? I'm not certain I'm making myself clear. I've done this in a DOS app but I don't have integer primary keys in DOS. In DOS, the actual fields are repeated so it is easy to do. Even though I have an integer primary key that relates the tables, is it a big no-no to have the name of the field as well? Than the indexing and dup-checking is easy.
>
>Thanks
Barbara Paltiel, Paltiel Inc.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform