Keyed vs. Nonkeyed Physical Files
From: Cynthy Johnson To: All
I need some help and supporting facts. As I started designing an application, I began to wonder whether the physical files should be keyed or whether they should be nonkeyed and use logical file access paths? I've found some pretty strong opinions on this topic. I was told that I should always key my physical file. I don't believe the issue is that simple. I think that there are pros and cons of always keying physical files. I need to present some strong arguments on both sides of the issue to my company. Can anyone help me out?
From: James Coolbaugh To: Cynthy Johnson
I have always used keyed physical files and have never run into any problems with them. When you key a physical file, all you are doing is attaching an index to the physical file. The data remains in input order until you reorganize or copy the data. Having a keyed physical allows you to have a consistent method of getting to the data. Of course, I use keyed physical files only when I have a unique key to the data in the file. If the key is not unique or there isn't really a standard method to retrieve an individual record, I don't really worry about it. I don't have any strong feelings on this one, except that I see no reason to limit the placement of keys on a physical file. If your database design is good, then it won't matter where your indexes are.
From: Pete Halsted To: Cynthy Johnson
The software that we use does not have any keyed physical files. They are all logical files. So far the things I like are:
1. In a major conversion you can delete all logical files, perform the conversion and recreate logical files much more quickly.
2. You do not run into the problem of not being able to change a key field since there are truly no keys.
On the down side, it does add another step in maintenance. You have more files to maintain since every file has at least one logical file.
From: Ted Holt To: Cynthy Johnson
I use both methods. I wrote an article, "Designing Databases for Flexibility" (MC, September 1990), which briefly touched on this. The advantage to not keying the physical file is that you don't have to delete all the logicals if the primary key changes. Or to state it backwards, if you have to change the key over a physical file, you have to delete and recreate all the logicals.
Other than that, I don't really think it makes that much difference.