[daisy] string or long Field Type in a small integer case?

Bruno Dumon bruno at outerthought.org
Thu Jun 21 11:56:44 CDT 2007


On Thu, 2007-06-21 at 18:44 +0200, Carlos Palol wrote:
> Hi,
> 
> I will use a privacy level field my intranet, it will hold value 0, 1,
> 2 or 3, corresponding to the organisation's 4 different levels of
> security for the document. This field will be in every document type,
> and will be checked all the time.
> 
> Looking at mysql "thefields" table, i woud say it's better to use a
> string type,

Why would, based on looking at the thefields table, a string type be
better? Field size?

>  but maybe it would be slower in the ACL....
> 
> Would someone recommend me whether to use a "string" filed type or a
> "long" field type? which would be more efficient?

If the string is short, there probably won't be a noticeable difference.

The ACL is evaluated in Java code, so it's the difference between
comparing a String and comparing a Long.

> 
> Many thanks in advance,
> 
> --
> Carlos Palol

-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno at outerthought.org                          bruno at apache.org



More information about the daisy mailing list