473,394 Members | 1,739 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Indexes and Primary key

Hello

I'm trying to find the best way to set indexes and primary keys on MSAccess
tables

What are the advantages and disadvantages of indexes and primary keys?
What fields should be indexed?
Should I index more than one field per table?
What fields should have the primary key?

and so on

Is there any good reading material on this available?
Thanks
G Gerard
Apr 18 '06 #1
1 1833
"GGerard" <gg*****@nbnet.nb.ca> wrote in
news:In*********************@ursa-nb00s0.nbnet.nb.ca:
Hello

I'm trying to find the best way to set indexes and primary
keys on MSAccess tables

What are the advantages and disadvantages of indexes and
primary keys? What fields should be indexed?
Should I index more than one field per table?
What fields should have the primary key?

and so on

Is there any good reading material on this available?
Thanks
G Gerard

The primary key to a table is a field or combination of fields
which uniquely identify a row in that table. You can often use
an autonumber field as a surrogate primary key. Some people will
say this is correct, others will claim that the natural primary
key is best. Personally, being an old dBase III programmer, I
avoid autonumbers. You may have database designs where you have
multiple candidates for primary key. These should be indexed.

As to general indexes, the idea is that if you use a field to
sort the table, or a combination of fields, these fields or
groups should be indexed, even if they are not the primary key.
You should also index fields and groups that are used to filter
the table.on a regular basis.

Some claim that the foreign keys in a table should be indexed
too. Foreign keys are the references used as the relation to
another table's primary key. Access apparently does this
automatically when you set a relation, but I don't have any
reason to believe that this is important. .

For reading material, any good textbook on relational database
design will discuss these topics in greater detail, try your
public or university library.

This web article is also good:
http://www.databasejournal.com/sqlet...le.php/1469521

--
Bob Quintal

PA is y I've altered my email address.
Apr 18 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: robertbrown1971 | last post by:
I just inherited a Java application with a fairly complex data model that does not yet have any indexes except those on primary keys. It is still in development and before I get to do any...
3
by: CSN | last post by:
In phppgadmin, primary keys are added/shown under "constraints". Does creating a primary key automatically create an index? No indexes are listed under phppgadmin's indexes page, but "\d table" in...
2
by: alex.mcshane | last post by:
Hi - I would be grateful for guidance regarding the following. (Please note that my DB2 backgorund is principally OS/390. I have only recently become involved in DB2 for LUW). OVERVIEW I...
2
by: tekanet | last post by:
Hello folks, I'm developing a program that reads an access MDB file and produce some scripts to rebuild the same structure against other databases (MSSQL, MySQL and so on). Reading structure...
5
by: Shiraz | last post by:
Is there some manual on how to make indexes? for example: table is create mytable ( a varchar, b varchar, c int, d int
2
by: Lyle Fairfield | last post by:
'Property Clustered As Boolean 'Member of DAO.Index Private Sub IsThereaClusteredIndex() Dim tdf As DAO.TableDef Dim idx As DAO.Index For Each tdf In DBEngine(0)(0).TableDefs For Each idx In...
14
by: Jeff | last post by:
This is the first time that I remember ever having too many indexes on a table, but it has happened. I have en employees table and store in many places, on tables, the id of the employee that...
22
by: Zamdrist | last post by:
I am tasked with maintaining a large database still on SQL Server 7.0. Performance is an issue not surprisingly and I've targeted two rather large tables to see what I can do with the indexes. ...
0
MMcCarthy
by: MMcCarthy | last post by:
The more data you include in your tables the more you will need to have indexes to search and sort that data. However, there is a balance between having enough indexes and too many. Too many...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.