On Thu, Sep 26, 2002 at 11:24:14AM -0700, Gary Traffanstedt wrote:
> sql,query
> 
> I have a table that has approximately 40 colums and all but 1 of
> them I have been able to make fixed width. The sole hold out is of
> the type "TEXT" and needs to be able to hold approximately 1000
> characters. The reason why I want it to be a fixed width field is
> for speed and reliability. From what I have read, if a table has no
> variable width fields, the database can access data faster.

Right.  There's a lot less work involved in locating a random row.
Since you know they're all the same size, it's a matter of
multiplication.  No need to check all the row headers.

> Maybe you can answer a couple of questions for me. First, will
> having all fixed-width fields make a noticeable difference?

That depends.  Can you benchmark it and see, using your real data?

> Second, is there a field that is fixed-width that can handle
> approximately 1,000 characters or is "TEXT" my only option?

No.  But you could use 4 CHAR(250) columns.  Or try and compress the
data to fit it into a 255 byte field (zlib, perhaps).

Jeremy
-- 
Jeremy D. Zawodny     |  Perl, Web, MySQL, Linux Magazine, Yahoo!
<[EMAIL PROTECTED]>  |  http://jeremy.zawodny.com/

MySQL 3.23.51: up 51 days, processed 1,092,346,376 queries (243/sec. avg)

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to