Dear Jasper,

I may not have been precise in my question, but the Unique Index in
question is a two fields index, and I was looking to find out wisdom
from the List if there is sense and/or experience in keying second(left)
field on in the Unique Index to speed up a search.
I am dealing with 32M rows table, where second field in the Unique Index
is a date field. Unfortunately for my simple "SELECT MAX(Date) as
Latest_Date from THE_TABLE" took 4 minutes and some seconds, so before I
will go and buy bigger server I needed to re-assure myself that there is
no other way.

I would not bother the List without a good reason and doing what you
said before

Regards,

Mikhail Berman

-----Original Message-----
From: Jasper Bryant-Greene [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 17, 2005 4:19 PM
To: Mikhail Berman
Cc: mysql@lists.mysql.com
Subject: Re: A "key" question

Mikhail Berman wrote:
> Is it possible or  makes sense to key a field that is a part of Unique

> Index already?

It's possible, but it doesn't make sense. A unique index is a normal
index with an added unique constraint. Adding another index on the same
field would make no sense (unless the field is a rightmost part of a
unique index).

Your question would have been answered by checking the archives less
than a week back (this question comes up a lot) or reading the manual.

Jasper

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to