473,387 Members | 1,512 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Performance of VARCHAR versus CHAR

Hi,

Does anybody have experience with the performance of CHAR in
comparison with VARCHAR? I´ve converted the table from varchar
(dynamic format) to char (fixed row length) and the total size of the
data doubles (not counting the keys).

The database structure is as follows, the database has about 0.5 mio.
entries right now with many intensive queries. As I have heard, fixed
rows are faster.. but what about the influence of the total disc space
on performance?

Tanks,

Andreas

--- Table-Structure:

CREATE TABLE descr (
id int(11) unsigned NOT NULL auto_increment,
descr char(100) NOT NULL default '',
seclevel smallint(4) NOT NULL default '0',
submitter char(55) NOT NULL default '0000',
time datetime NOT NULL default '0000-00-00 00:00:00',
userid mediumint(6) unsigned NOT NULL default '0',
cat mediumint(6) unsigned NOT NULL default '0',
thumb_x tinyint(3) unsigned NOT NULL default '0',
thumb_y tinyint(3) unsigned NOT NULL default '0',
points smallint(4) NOT NULL default '0',
channel smallint(4) NOT NULL default '1',
active enum('n','p','x','y','z') NOT NULL default 'y',
pcat mediumint(6) unsigned NOT NULL default '0',
movechannel smallint(4) NOT NULL default '0',
movecat mediumint(6) unsigned NOT NULL default '0',
movetime datetime NOT NULL default '0000-00-00 00:00:00',
comments smallint(4) NOT NULL default '-1',
ptime datetime NOT NULL default '0000-00-00 00:00:00',
parserver tinyint(3) unsigned NOT NULL default '0',
fflag enum('0','u','v','p','h','1','2','3') NOT NULL default '0',
language enum('0','1','2','3','4') NOT NULL default '0',
PRIMARY KEY (id),
KEY userid (userid),
KEY channel (channel),
KEY pcat (pcat),
KEY movechannel (movechannel),
KEY movecat (movecat),
KEY movetime (movetime),
KEY ptime (ptime),
KEY time (time),
KEY catview (cat,active,time)
) TYPE=MyISAM ROW_FORMAT=FIXED;
Jul 19 '05 #1
2 5016
I can't answer your question, but I have also done something similar
-- making sure a table that used to use VARCHAR used only fixed length
CHAR. This is on a database that gets about 200 updates per second on
avg. Even with everything being fixed length, the database still needs
to be optimized once in a while because despite the fixed lengths --
it still gets fragmented.

On 5 Nov 2003 05:11:38 -0800, ma**@fotocommunity.de (Andreas Meyer)
wrote:
Hi,

Does anybody have experience with the performance of CHAR in
comparison with VARCHAR? I´ve converted the table from varchar
(dynamic format) to char (fixed row length) and the total size of the
data doubles (not counting the keys).

The database structure is as follows, the database has about 0.5 mio.
entries right now with many intensive queries. As I have heard, fixed
rows are faster.. but what about the influence of the total disc space
on performance?

Tanks,

Andreas

--- Table-Structure:

CREATE TABLE descr (
id int(11) unsigned NOT NULL auto_increment,
descr char(100) NOT NULL default '',
seclevel smallint(4) NOT NULL default '0',
submitter char(55) NOT NULL default '0000',
time datetime NOT NULL default '0000-00-00 00:00:00',
userid mediumint(6) unsigned NOT NULL default '0',
cat mediumint(6) unsigned NOT NULL default '0',
thumb_x tinyint(3) unsigned NOT NULL default '0',
thumb_y tinyint(3) unsigned NOT NULL default '0',
points smallint(4) NOT NULL default '0',
channel smallint(4) NOT NULL default '1',
active enum('n','p','x','y','z') NOT NULL default 'y',
pcat mediumint(6) unsigned NOT NULL default '0',
movechannel smallint(4) NOT NULL default '0',
movecat mediumint(6) unsigned NOT NULL default '0',
movetime datetime NOT NULL default '0000-00-00 00:00:00',
comments smallint(4) NOT NULL default '-1',
ptime datetime NOT NULL default '0000-00-00 00:00:00',
parserver tinyint(3) unsigned NOT NULL default '0',
fflag enum('0','u','v','p','h','1','2','3') NOT NULL default '0',
language enum('0','1','2','3','4') NOT NULL default '0',
PRIMARY KEY (id),
KEY userid (userid),
KEY channel (channel),
KEY pcat (pcat),
KEY movechannel (movechannel),
KEY movecat (movecat),
KEY movetime (movetime),
KEY ptime (ptime),
KEY time (time),
KEY catview (cat,active,time)
) TYPE=MyISAM ROW_FORMAT=FIXED;


Jul 19 '05 #2
I can't answer your question, but I have also done something similar
-- making sure a table that used to use VARCHAR used only fixed length
CHAR. This is on a database that gets about 200 updates per second on
avg. Even with everything being fixed length, the database still needs
to be optimized once in a while because despite the fixed lengths --
it still gets fragmented.

On 5 Nov 2003 05:11:38 -0800, ma**@fotocommunity.de (Andreas Meyer)
wrote:
Hi,

Does anybody have experience with the performance of CHAR in
comparison with VARCHAR? I´ve converted the table from varchar
(dynamic format) to char (fixed row length) and the total size of the
data doubles (not counting the keys).

The database structure is as follows, the database has about 0.5 mio.
entries right now with many intensive queries. As I have heard, fixed
rows are faster.. but what about the influence of the total disc space
on performance?

Tanks,

Andreas

--- Table-Structure:

CREATE TABLE descr (
id int(11) unsigned NOT NULL auto_increment,
descr char(100) NOT NULL default '',
seclevel smallint(4) NOT NULL default '0',
submitter char(55) NOT NULL default '0000',
time datetime NOT NULL default '0000-00-00 00:00:00',
userid mediumint(6) unsigned NOT NULL default '0',
cat mediumint(6) unsigned NOT NULL default '0',
thumb_x tinyint(3) unsigned NOT NULL default '0',
thumb_y tinyint(3) unsigned NOT NULL default '0',
points smallint(4) NOT NULL default '0',
channel smallint(4) NOT NULL default '1',
active enum('n','p','x','y','z') NOT NULL default 'y',
pcat mediumint(6) unsigned NOT NULL default '0',
movechannel smallint(4) NOT NULL default '0',
movecat mediumint(6) unsigned NOT NULL default '0',
movetime datetime NOT NULL default '0000-00-00 00:00:00',
comments smallint(4) NOT NULL default '-1',
ptime datetime NOT NULL default '0000-00-00 00:00:00',
parserver tinyint(3) unsigned NOT NULL default '0',
fflag enum('0','u','v','p','h','1','2','3') NOT NULL default '0',
language enum('0','1','2','3','4') NOT NULL default '0',
PRIMARY KEY (id),
KEY userid (userid),
KEY channel (channel),
KEY pcat (pcat),
KEY movechannel (movechannel),
KEY movecat (movecat),
KEY movetime (movetime),
KEY ptime (ptime),
KEY time (time),
KEY catview (cat,active,time)
) TYPE=MyISAM ROW_FORMAT=FIXED;


Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Andreas Meyer | last post by:
Hi, Does anybody have experience with the performance of CHAR in comparison with VARCHAR? I´ve converted the table from varchar (dynamic format) to char (fixed row length) and the total size of...
6
by: pragile | last post by:
I have a stored procedure that has some problems with slow performance. The procedure has 2 parameters @firstname varchar(100) @lastname varchar(100) These parameters can have values like a%,...
5
by: twkelsey | last post by:
Hi, My company has a scenario where we would like to change the data type of an existing primary key from an integer to a char, but we are concerned about the performance implications of doing...
5
by: hishamfangs | last post by:
Hi guys! I'm facing a problem and I can't quite figure it out! I have created a table on SQL Server 2000 to store call records. We get about 250,000 calls a day, and the most frequently used...
2
by: Schardosim | last post by:
HI, I am making the importation of 200.000 rows for one temporary table. To leave of this temporary table insert, updates and deletes for other tables are executed. However the reply time that...
3
by: kenfar | last post by:
I've got a UDF that is used on the publishing side of a data warehouse: when the data is headed out to a mart. It works fine for sets of a few thousand rows, but really slows for sets of a few...
2
by: rAinDeEr | last post by:
Hi, I have a table with the following definition. The primary key is west_nme and west_eff_tms and i have created unique index on them. The foreign keys which reference other parent tables are...
4
by: Andrew S | last post by:
Hello Mr. Expert: - I have 3 tables in mysql in MyISAM table format, I am using mysql4.0 on freebsd5.3 - producttbl, productdetailentbl, pricetblN - they all have "productid" as the Primary KEY....
1
by: Rudolf Bargholz | last post by:
Hi, We have created triggers to log modifications to tables in our application. The triggers work fine, just on one of the tables in our database the triggers fail with the error message...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.