| Previous · Next | |
| User | Message |
|
JT
|
Date: 10/21/2008 10:15 am · Subject: char vs varchar · Rating: 0
Going forward any place in WebGUI that you use a varchar in database table construction, use a char instead. We will be updating WebGUI to use chars instead of varchars everywhere. The reason for this change is that chars perform better and are less likely to cause MYISAM corruption issues. The change doesn't come without a cost though. It means that the tables will use slightly more disk space. But my thinking is that disk space is cheap compared to any performance benefit at all, and the cost of downtime due to possible MYISAM table crashes. JT Smith ph: 703-286-2525 x810 fx: 312-264-5382 Create like a god. Command like a king. Work like a slave. |
| Back to Top |
Rate [ | ]
|
|
knowmad
|
Date: 10/21/2008 5:02 pm · Subject: Re: char vs varchar · Rating: 0
This sounds reasonable. Did you come across an article that details the reasons behind your decisions? Please share.
William ---- |
| Back to Top |
Rate [ | ]
|
|
JT
|
Date: 10/21/2008 5:25 pm · Subject: Re: char vs varchar · Rating: 0
Not a particular article, just through user testing. There was something on the MySQL site (I forget where) that said that CHAR is more stable than VARCHAR, but it wasn't particularly specific. We had a client who kept getting corrupted cache and assetIndex tables. I couldn't figure out what it was about. On a hunch I changed all the fields in those two tables that were varchars to chars and we haven't had a corruption in a month. It was corrupting every day, sometimes more than once per day. Also if you read the docs on the MySQL site it flat out says that CHARS are more speedy than VARCHARS in certain situations simply because CHARS have a known length, so there is less scanning work. |
| Back to Top |
Rate [ | ]
|
|
dionak
|
Date: 10/21/2008 6:55 pm · Subject: Re: char vs varchar · Rating: 0
Interesting. Thanks for sharing. On Tue, Oct 21, 2008 at 6:25 PM, <jt@plainblack.com> wrote: JT wrote: -- Knowmad Technologies - Open Source Software Solutions W: http://www.knowmad.com | E: diona@knowmad.com P: 704.343.9330 | http://www.LinkedIn.com/in/dionakidd |
| Back to Top |
Rate [ | ]
|