[mso] Re: Access Index

  • From: chizotz@xxxxxxxxx
  • To: mso@xxxxxxxxxxxxx
  • Date: Wed, 11 Aug 2004 16:25:17 +0000

You can create indexes on tables through SQL. The syntax is

CREATE [UNIQUE] INDEX indexName
ON tableName (column1Name [,column2Name,...])
[WITH [PRIMARY | DISALLOW NULL | IGNORE NULL]

examples:

CREATE INDEX idx_acct_nbr
ON tblCustomers (acct_nbr)
WITH PRIMARY;

Would create a primary key (no duplicates, no nulls) index on the acct_nbr 
field in the tblCustomers table.

CREATE UNIQUE INDEX idx_ssn
ON tblCustomers (ssn)
WITH DISALLOW NULL;

would create an index on the ssn field in tblCustomers, no duplicates and no 
nulls but does not make it a primary key.

CREATE INDEX idx_zip
ON tblCustomers (zip);

would simply create a non-unique index on the zip field.

You can include multiple column indexes by including them in the field list 
seperated by commas. Experiment with your data to get the indexes you need 
working. This will be better that the append method you describe in that the 
deleting and appending of records will cause your file size to grow and more 
quickly require compaction, while adding indexes to existing tables will only 
increase the file size by the size of the index and won't directly cause the 
need for more frequent compactions.

HTH,

Ron
 

> Hi All. 
> I get new tables every morning for a database.  The tables are not
> indexed.  Indexing makes a huge difference in processing speed when
> running queries so I manually index the tables.  The tables always have
> the same name.  Is there a way to make the desired indexes happen by
> default? Or can some process be written the sets the indexes?
> 
> The only thing I've been able to think of is to create duplicate tables
> with the index set then use append queries to post the new daily data
> and run all queries, etc off the indexed tables.  The process would be
> 
> delete data from indexed tables 
> run append queries on new tables to post fresh data to indexed tables 
> 
> does this make sense?  is there a better way? 
> 
> thanks. /g 
> 
> 
>   _____  
> 
> << ella for Spam Control >> has removed 11743 Spam messages and set
> aside 0 Newsletters for me
> You can use it too - and it's FREE!  www.ellaforspam.com      
> 
> *************************************************************
> You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or 
> MicrosoftOffice@xxxxxxxxxxxxxxxx
> 
> To send mail to the group, simply address it to mso@xxxxxxxxxxxxx
> 
> To Unsubscribe from this group, send an email to 
> mso-request@xxxxxxxxxxxxx with the word "unsubscribe" (without the quotes) in 
> the subject line.
> 
> Or, visit the group's homepage and use the dropdown menu.  This will also 
> allow 
> you to change your email settings to digest or vacation (no mail).
> //www.freelists.org/webpage/mso
> 
> To be able to use the files section for sharing files with the group, send a 
> request to mso-moderators@xxxxxxxxxxxxx and you will be sent an invitation 
> with 
> instructions.  Once you are a member of the files group, you can go here to 
> upload/download files:
> http://www.smartgroups.com/vault/msofiles
> *************************************************************
*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or 
MicrosoftOffice@xxxxxxxxxxxxxxxx

To send mail to the group, simply address it to mso@xxxxxxxxxxxxx

To Unsubscribe from this group, send an email to 
mso-request@xxxxxxxxxxxxx with the word "unsubscribe" (without the quotes) in 
the subject line.

Or, visit the group's homepage and use the dropdown menu.  This will also allow 
you to change your email settings to digest or vacation (no mail).
//www.freelists.org/webpage/mso

To be able to use the files section for sharing files with the group, send a 
request to mso-moderators@xxxxxxxxxxxxx and you will be sent an invitation with 
instructions.  Once you are a member of the files group, you can go here to 
upload/download files:
http://www.smartgroups.com/vault/msofiles
*************************************************************

Other related posts: