List:General Discussion« Previous MessageNext Message »
From:Pooly Date:January 17 2006 12:46pm
Subject:Re: CHAR vs TEXT and fast Row Updates
View as plain text  

2006/1/17, Karl Pielorz <kpielorz@stripped>:
> Hi All,

> 1. Fixed length CHAR fields are quicker to update than VARCHAR fields
> (because the field size is constant)

There is no advantage if not all your field in your table are fixed
size. as soon as you add a text/blob column, you loose the fixed row
Keep in mind that index will also be fixed-length, and it can be more
efficient to have varchar to have quick select.

> Do we get any 'saving' by using a TEXT field, and pre-populating this with
> say 2K of 'spaces' when we create the 5,000 rows - and then ensuring that
> the UPDATE operation always writes 2K of text to the field? - e.g. will
> this avoid MySQL having to 'free up' the space for the field, then
> re-allocate 2K again for it.

space is not reclaimed after deletion until you run an : optimize table.

Webzine Rock :
CHAR vs TEXT and fast Row UpdatesKarl Pielorz17 Jan
  • Re: CHAR vs TEXT and fast Row UpdatesPooly17 Jan