Apple: overpriced RAMs, idiot geniuses
I passed by the Apple Store downtown yesterday, hoping to pick up 4GBs of RAMs for my Mac Pro. I guess it works the same in all their stores, I first had to chat with a ‘janitor’ so she can pair me with a ‘genius’.
Why?
The first ‘genius’ assisting me, understood everything I needed but screwed up on 2 occasions: * Confirmed to me that 4GBs would cost $CA 399.99 * Transfered me to a different ‘genius’ when I said I was ready to buy
The second ‘idiot’, didn’t understand nothing. Given the fact that I already had to be transfered and wait for a second time, one can imagine I wasn’t really happy. First, she thought I was talking about the G5 and suggested I wait while she goes and checks if they have some RAMs in stock (even if those were the ones I needed, you don’t keep a digital inventory?!). I take the time explaining to her that it’s not a G5 but a Mac Pro. She then asks me to wait while she helps one of her colleagues with another customer. A couple minutes later she comes back.
Genius: Sir, you are aware that you will have to remove the current RAM you have
Me: No! Why exactly?
Genius: Because you can only have 2 paired sticks at once
Me: Are you serious? I am talking about a Mac Pro - are you really sure of what you are saying?
Genius: Positive sir.
Me: Ok, go on to your site and let me see how the Mac Pro is advertised - 32GBs of RAMs, is that only by using 2 x 16GBs sticks? I doubt it!
Genius: No sir. The Macbook Pro can only take 2 sticks.
Me: Did you just say Macbook Pro? I’ve been talking about the Mac Pro - wake up please!
It doesn’t stop there
She then goes to the back and 10 minutes later, comes back with a carton of RAMs. The curious guy I am, I start playing with the box while she is preparing the bill and notice 2 things: * The box contains 2 x 1GB RAMs, I asked for 2 x 2GB. * 2GBs RAMs are selling for $CA 499, what happened to the $CA 399.95 for 4GBs the other ‘genius’ confirmed?
That’s when I was really fed up to try understanding. I stepped out of the store, logged to eBay while walking to the car and ordered my 4GBs for Mac Pro for less than half the price Apple wants for 2GBs!
The downside
I have to wait until next week to get them…
VAR or VARCHAR, which to choose?
While I was optimizing the database for the application I am currently developing, I thoroughly check the differences between these two types, VAR and VARCHAR, so might as well share my notes here. Keep in mind that these are for MySQL 5.0.3 and later, things were different in certain cases before.
CHAR
- string, length from 0 to 255
- required storage depends on the set length
- values are right-padded with spaces to the specified length when stored
- trailing spaces are removed when values are retrieved
- values that exceeds the specified length are truncated, warning is generated (strict SQL mode disabled, otherwise error and not stored)
VARCHAR
- string, length from 0 to 65,535 (but subject to maximum row size which is shared among all columns)
- required storage depends on the stored value
- values are not padded when stored
- trailing spaces are retained when values are stored or retrieved
- values that exceeds the specified length are truncated, warning is generated (strict SQL mode disabled, otherwise error and not stored)
Finally, a couple examples to illustrate it all:
mysql > CREATE DATABASE sandbox;
mysql > USE sandbox;
mysql > CREATE TABLE vc (`c` char(3), `v` char(3));
mysql > INSERT INTO vc VALUES ('', ''), (' ', ' '), ('a', 'a'), ('a ', 'a '), ('abc', 'abc');
mysql > SELECT CONCAT('(', c, ')'), CONCAT('(', v, ')');
That last query will return:
+---------------------+---------------------+
| CONCAT('(', c, ')') | CONCAT('(', v, ')') |
+---------------------+---------------------+
| () | () |
| () | ( ) |
| (a) | (a) |
| (a) | (a ) |
| (abc) | (abc) |
+---------------------+---------------------+
Notice how for CHAR the trailing space is removed. Another interesting thing to note, sorting and comparing CHAR and VARCHAR columns:
mysql > SELECT c = 'a ', v = 'a ' FROM vc;
+---------------------+
| c = 'a ' | v = 'a ' |
+---------------------+
| 0 | 0 |
| 0 | 0 |
| 1 | 1 |
| 1 | 1 |
| 0 | 0 |
+---------------------+
As you can see, it compares values without regard to any trailing spaces.
There, that should resume it all and hopefully help next time there is a field type to set. Did I forget to mention anything? Let me know in the comments.

