well I index both because it enables to pull data without even reading
on the table.It reads  only in the B-Tree index since it's both numeric.

There is a section on mySQl optimization in the mySQL guide on the
webpage.

If you want to find all files that have this or that extension, mySQL
will use the (typeID,fileID) index

if you are looking for the index of a particular file, it will use the
index (fileID, typeID). 
this is for speed!

HTH

Etienne

Erik Price wrote:
> 
> On Tuesday, December 4, 2001, at 01:23  PM, Etienne Marcotte wrote:
> 
> > CREATE TABLE filetypes (
> > fileID smallint unsigned not null,
> > typeID smallint unsigned not null,
> > unique index (fileID,typeID),
> > unique index (typeID,fileID)
> > )
> 
> One question, though.  Do I have to construct indexes in both
> directions?  I haven't used the UNIQUE INDEX command.  I still have much
> to learn -- I'm only partway through the DuBois book that I am using to
> learn MySQL.  The chapter on optimizing databases and indexing is next.
> 
> Well, no need to respond to that.  I will study further before asking
> any more questions.
> 
> Erik

-- 
Etienne Marcotte
Specifications Management - Quality Control
Imperial Tobacco Ltd. - Montreal (Qc) Canada
514.932.6161 x.4001

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to