RE: indexing error - key length not specified

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Micah,


> You can't use that column type as an index because it's variable length.

Makes sense.


> Make it a varchar or something that's definite to index it.

It is possible the value stored can reach up to about 2k characters, which
is too long for a varchar type.  Any recommendations as to what type to use
that wouldn't be variable length, but be able to store strings/values of
that size?

Thanks!

John

-----Original Message-----
From: Micah Stevens [mailto:micah@xxxxxxxxxxxxxxxxxx] 
Sent: Friday, February 09, 2007 6:29 PM
To: John Pillion
Cc: php-db@xxxxxxxxxxxxx
Subject: Re:  indexing error - key length not specified

You can't use that column type as an index because it's variable length.

Make it a varchar or something that's definite to index it.

-Micah

On 02/09/2007 03:56 PM, John Pillion wrote:
> I am trying to set an index on a field in my table, but am getting the
> following error:
>
>  
>
>     BLOB column 'ReadBy' used in key specification without a key length
>
>  
>
> The fieldtype is blob, though I get the same error whether blob or text,
or
> the medium and long versions of each.  My first though, based on the
error,
> was I needed to set a length to the field - but it won't accept/store any
> length I give it (because it's a variable length?)
>
>  
>
> I'm using mysql on from 1and1 (hosting provider), though I don't know what
> version they're running
>
>  
>
> .. any thoughts?
>
>  
>
>  
>
> As an alternative, how much less efficient would it be to do a ".LIKE
> '%mystring%'" versus a MATCH..?
>
>  
>
>  
>
>
>   

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux