Hi,
On Friday 15 November 2002 00:22, Michael Wang wrote:
> I found that URI column in OBJECTS and REVISIONS tables are limited
> to 255 chars in MySQL and DB2, due to the primary key constraint.
>
> The purpose of this posting is to confirm this, and to seek opinions and
> workaround.
>
> Thanks.
>
> (1) MySQL
>
> Copied from JDBC How To:
>
> "
> create table objects(uri blob not null, primary key uriIndex (uri(255)),
> classname blob);
MySQL version 3.22.32 (Suse Linux 7.0):
mysql> create table objects(uri blob not null, primary key uriIndex
(uri(255)), classname blob);
ERROR 1073: BLOB column 'uri' can't be used in key specification
with the used table type
The statement from the manual is not working at all for my installation.
You could somehow change the table type, but most people would
not do this. What is your target mysql version and which store are you
talking about. Indices on blobs are allowed since 3.23.2.
>
> I believe PRIMARY KEY is used to enforce uniqueness as well as indexing.
> If this is true, URI exceeds 255, and PRIMARY KEY is only done on the
> first 255 chars, then the uniqueness is not enforced.
There is no real need to the enforce the uniqueness at the databank level,
if the application cares about it. Its just a guard against bugs in slide.
However you still need a index on uri to get acceptable performance.
> The key is limited to 255 on a single column in MySQL (both MyISAM and
> innoDB), having a larger URI column only create a hidden problem. It is
> better to make the problem up front. For this reason, I would suggest
> changing above to
>
> "
> create table objects(uri varchar(255) not null, primary key uriIndex
> (uri(255)), classname blob);
> "
Limiting the uri length to 255 character is not acceptable for many
applications. IIRC most browsers have a url length limit of 4096 and posix
requires a minimum filename length of 1024. 255 characters woud be a
serious limitation for webdav.
> How do you think? And anyone has an idea to make URI beyond 255 in MySQL?
You could create some kind of hash from the uri string and pray, that you
don't get key collisions. For MD5 key collisions are very unlikely, but
I guess calculation is to slow.
Martin
--
To unsubscribe, e-mail: <mailto:slide-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:slide-user-help@;jakarta.apache.org>