At 14:33 -0700 1/22/04, [EMAIL PROTECTED] wrote:
Paul wrote:

Is there such a thing as an index on the first 8 characters of a DATETIME column?

No. Indexes on partial column values are available only for string
types.


Won't PACK_KEYS=1 help in a situation like this?

Yes, but it's a different question. This is not the same thing as creating an index on the initial part of column values, which is something that you can do with string columns.


From the Documentation:
6.5.3 CREATE TABLE Syntax
If you don't use PACK_KEYS, the default is to only pack strings, not
numbers. If you use PACK_KEYS=1, numbers will be packed as well. When
packing binary number keys, MySQL will use prefix compression. This
means that you will only get a big benefit from this if you have many
numbers that are the same. Prefix compression means that every key needs
one extra byte to indicate how many bytes of the previous key are the
same for the next key (note that the pointer to the row is stored in
high-byte-first order directly after the key, to improve compression).
This means that if you have many equal keys on two consecutive rows, all
following ``same'' keys will usually only take 2 bytes (including the
pointer to the row).

Ed


--
Paul DuBois, MySQL Documentation Team
Madison, Wisconsin, USA
MySQL AB, www.mysql.com

MySQL Users Conference: April 14-16, 2004
http://www.mysql.com/uc2004/

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



Reply via email to