473,405 Members | 2,272 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,405 software developers and data experts.

Index Field

------_=_NextPart_001_01C35278.EC37A6F0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi All,

Just a quick question on whether I need both fields to be indexed.

The table is as below.. I'm wondering if I need to have these 2 fields =
->
fa_id & serial_no

fa_id would be a 7 character int like "0000001", "0000002"
serial_no would be like "WMACK0000001", "WMACM0000121"

most of the time, we'll be referencing the serial_no more as it's what's
being used most often in my nature of work. Initially I thought that I =
could
index or make serial_no my primary key but as it's not fully numeric, =
I'm
not sure if this is advisable.

Can anyone help me out? Do I need the fa_id field? If I were to use =
mysql to
query for data, most likely I'll be using the Serial_no as the reference =
and
not fa_id.=20

Comments....Thanks.

CREATE TABLE fa_tracker (
fa_id int(7) unsigned NOT NULL auto_increment,
serial_no varchar(12) NOT NULL default '',
dcm varchar(13) NOT NULL default '',
family_id smallint(3) unsigned NOT NULL default '0',
dcm_id smallint(3) unsigned NOT NULL default '0',
media_id smallint(3) unsigned NOT NULL default '0',
headers enum('1','2','3','4','5','6') default NULL,
fail_heads enum('0','1','2','3','4','5') default NULL,
source_id smallint(3) unsigned NOT NULL default '0',
drive_cat_id smallint(3) unsigned NOT NULL default '0',
drive_fa text NOT NULL,
hm_cat_id smallint(3) unsigned NOT NULL default '0',
hm_fa text NOT NULL,
supplier_cat_id smallint(3) unsigned NOT NULL default '0',
supplier_as_lab_fa text NOT NULL,
date_submitted datetime NOT NULL default '1970-01-01 00:00:01',
date_received datetime NOT NULL default '1970-01-01 00:00:01',
date_sent datetime NOT NULL default '1970-01-01 00:00:01',
dept_id smallint(3) unsigned NOT NULL default '0',
user_id int(7) unsigned NOT NULL default '0',
PRIMARY KEY (fa_id),
UNIQUE KEY serial_no (serial_no)
)=20

Cheers,
Mun Heng, Ow
H/M Engineering
Western Digital M'sia=20
DID : 03-7870 5168
------_=_NextPart_001_01C35278.EC37A6F0--
Jul 19 '05 #1
0 2439

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

Similar topics

4
by: John | last post by:
Hi all - I'm trying to build a small Access Database (that came with VB5) - I'd like the database records sorted and displayed by date (which it does - date is an indexed field) but if I have...
1
by: Johann Uhrmann | last post by:
Hello, are there any experiences about the performance of indices with different data types. How do the performance of an index that consists of - an integer field - a varchar() field - a...
3
by: Patrick Hatcher | last post by:
I have a timestamp field where I find I'm doing a lot of searching by date (YYYY-MM-DD) or using this field as a match to another table that has a date format. I wanted to create an index on the ...
2
by: Kostas | last post by:
I ve been told from Allen and others that when enforcing referential integrity Access creates a hidden index for the foreign key, therefore, I do not need to re-index it myself. However, I...
3
by: lauren quantrell | last post by:
In a table design, properties window there is the Indexes/Keys tab. I want to create a few indexes. Row myID is the PK. I also want indexes on rows myOne, myTwo, myThree. In the selected...
8
by: Mike Wertheim | last post by:
Hi, I'm using PostgreSQL 8. I have two tables that I am doing a join on, and the join executes very slowly. The table called Notification has a text field called NotificationID, which is...
2
by: bobby_b_ | last post by:
I have a table where fields 1 and 2 make up the primary key. Because of this, I have a unique composite index on fields 1 and 2 (as required by DB2). Now my question is: Fields 1 and 2 are also...
1
by: jhall | last post by:
At some point an index has been added to a table in my Access DB that does not allow duplicates. I can't see where I ever put an index on this field. But, when I tried to add 2nd records with a...
2
by: Enorme Vigenti | last post by:
Hi all, I have a very large table with many columns: dateTime type, nvarchar type and integer field type. A program exec many type of query with where clause. Data field is always in where...
1
BeemerBiker
by: BeemerBiker | last post by:
Using GridView and SqlDataSource I found that an index field defaults to "ReadOnly=True" and I have to change it to False and then hide it before my sql UPDATE command works. This seems awkward and...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.