June 18, 2013

Post: Trailing spaces in MySQL

… things changed so now VARCHAR keeps trailing spaces while CHAR columns do not any more. Well in reality CHAR columns are padded to… account if you mind trailing spaces stored choosing VARCHAR vs CHAR in addition to fixed length vs dynamic level rows and space spent for…, even if VARCHAR column is used which is pretty counterintuitive. So “a “=”a”=”a ” for all textual column types – CHAR, VARCHAR, TEXT. BLOB…

Post: Enum Fields VS Varchar VS Int + Joined table: What is Faster?

… in customers’ application we can see a huge tables with varchar/char fields, with small sets of possible values. These are “state…) Table with VARCHAR: CREATE TABLE cities_varchar ( id int(10) unsigned NOT NULL auto_increment, state varchar(50) NOT NULL, city varchar(255) NOT…(mean): 0.082196 2) Results for VARCHAR: select SQL_NO_CACHE city from cities_varchar WHERE state=’Minnesota’ limit 10000,5; Result…

Comment: Using CHAR keys for joins, how much is the overhead ?

I tried running VARCHAR vs CHAR for sha1 ids The join took 3.90 seconds for CHAR(40) and 4.05 seconds for VARCHAR(40) using latin1 encoding Innodb tables. So there is indeed benefits from using CHAR type for this type of column while it is not significant.

Comment: Enum Fields VS Varchar VS Int + Joined table: What is Faster?

[...] about it, but after that session I was looking up some VARCHAR vs CHAR debate information and found this post on the MySQL Performance Blog. Turns out his idea isn’t really that crazy (performance-wise, at [...]

Post: MySQL 5.6 vs MySQL 5.5 and the Star Schema Benchmark

… id=”attachment_13599″ align=”alignright” width=”210″] MySQL 5.6 vs MySQL 5.5 & the Star Schema Benchmark[/caption] So far…_MFGR varchar(10), P_Category varchar(10), P_Brand varchar(15), P_Colour varchar(15), P_Type varchar(25), P_Size tinyint, P_Container char(10… key, S_Name char(25), S_Address varchar(25), S_City char(10), S_Nation char(15), S_Region char(12), S_Phone char(15), key…

Post: Common MySQL traps webinar questions followup

…: Do you have a recommendation on when to use ENUM vs. CHAR? Especially for one character values? Let’s say you want…’. If you use a string, a VARCHAR(15) could be good to store such values (A CHAR(8) too, but it will… long as you use a 1-byte character set for CHAR). Here CHARs will be more flexible and can avoid some subtleties…

Post: MySQL 6.0 vs 5.1 in TPC-H queries

…` decimal(15,2) NOT NULL, `l_returnflag` char(1) NOT NULL, `l_linestatus` char(1) NOT NULL, `l_commitdate` date NOT NULL, `l_receiptdate` date NOT NULL, `l_shipinstruct` char(25) NOT NULL, `l_comment` varchar(44) NOT NULL, `l_shipmode` char(10) NOT NULL, PRIMARY KEY…

Post: Analyzing air traffic performance with InfoBright and MonetDB

varchar(10) DEFAULT NULL, `Origin` char(5) DEFAULT NULL, `OriginCityName` varchar(100) DEFAULT NULL, `OriginState` char(2) DEFAULT NULL, `OriginStateFips` varchar(10) DEFAULT NULL, `OriginStateName` varchar…: This experiment was not really about InfoBright vs MonetDB comparison. My goal was to check…