At 10:10 +0200 1/14/03, Octavian Rasnita wrote:
Can I index just a smaller number of characters from a field even though the
field has more?
Will this make MySQL to index that field faster?
For BLOB and TEXT columns, you *must* in fact index just a certain number
of bytes (maximum of 255 bytes).
On Tue, Jan 14, 2003 at 10:10:02AM +0200, Octavian Rasnita wrote:
> Can I index just a smaller number of characters from a field even though the
> field has more?
> Will this make MySQL to index that field faster?
Good Day Octavian,
You can index part of a column with the syntax
INDEX
TED]>
To: "David T-G" <[EMAIL PROTECTED]>
Cc: "mysql users" <[EMAIL PROTECTED]>
Sent: Tuesday, December 31, 2002 1:47 AM
Subject: Re: indexing a blob
On Mon, Dec 30, 2002 at 04:53:08PM -0500, David T-G wrote:
>
> Hi, all --
>
> Having learned a bit abo
Hi.
On Mon 2002-12-30 at 16:53:08 -0500, [EMAIL PROTECTED] wrote:
[...]
> hashsum tinyblob not null , # hash of the card: have we seen this one?
> index (hashsum) # for quick lookups
>
> Whenever I try this with the index, I get
>
> ERROR 1170 at line 49: BLOB column 'h
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Hi, all --
...and then David T-G said...
%
...
% hashsum tinyblob not null , # hash of the card: have we seen this one?
% index (hashsum) # for quick lookups
...
% ERROR 1170 at line 49: BLOB column 'hash' used in key specif
On 30 Dec 2002, at 16:53, David T-G wrote:
> I don't know where the key length needs to be specified; I tried
>
> hashsum tinyblob(255) not null
>
> but that puked at the create stage :-)
The prefix length goes with the index definition, not the column
definition. See http://www.mysql.com/d
http://www.mysql.com/doc/en/CREATE_INDEX.html
you key needs a length, not your field.
index (hashsum(length)) # for quick lookups
-Original Message-
From: David T-G [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 30, 2002 1:53 PM
To: mysql users
Subject: indexing a blob
-
On Mon, Dec 30, 2002 at 04:53:08PM -0500, David T-G wrote:
>
> Hi, all --
>
> Having learned a bit about indexes, I have tried to practice a bit. So
> far things work for my char(20) fields, but I have a problem with a
> tinyblob. To wit:
>
> create table ccards
> (
> # ID number
>