List Info

Thread: Re: MySQL Performance Example Was: Seriously, WTF?




Re: MySQL Performance Example Was: Seriously, WTF?
country flaguser name
United Kingdom
2008-05-09 10:47:23
On 9 May 2008, at 11:02 am, Christopher Jones wrote:

>
> Since `chr` is a set of defined values, at some point I
did have it  
> as an ENUM. But then I read somewhere that this is bad,
so it got  
> changed to VARCHAR. I always assumed that VARCHAR was
better than  
> CHAR, and that the length didn't matter because it was 

> variable....! So is ENUM bad? Would it be better/worse
than CHAR?


Int, enum, char in that order.

I'd avoid enum and just create a 'chr' table with an
identity/auto- 
increment column as the pk, stick an index on it (if mySQL
hasn't set  
one up on the pk) and join it to the histones table. No
problem with  
adding new records to chr, or in the gotchas about dealing
with  
enums. Then the multiple column index on histones will
(should  
perform faster.


Iain


Re: MySQL Performance Example Was: Seriously, WTF?
country flaguser name
United Kingdom
2008-05-09 11:07:56
On Fri, May 09, 2008 at 04:47:23PM +0100, Iain Barnett
wrote:

> Int, enum, char in that order.

I've always treated ENUM as being more a reminder to myself
and to
whoever has to maintain my stuff about what the column is
for.  eg, that
the 'pigment' field can contain cyan, magenta, yellow or
black but
nothing else.  It also saves the hassle of me having to
remember which
of C M Y and K maps to which integer, and saves the database
the hassle
of looking up the human-readable names for those integers in
another
table.

-- 
David Cantrell | top google result for "topless karaoke
murders"

    Deck of Cards: $1.29.
    "101 Solitaire Variations" book: $6.59.
    Cheap replacement for the one thing Windows is good at:
priceless
        -- Shane Lazarus

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )