Just to clarify, the RAM usage does not directly affect sketch length.
As an example:
byte foo [1000]; // takes 1000 bytes of RAM
int bar [1000]; // takes 2000 bytes of RAM
Whilst the compiler generates more code to access "bar" than "foo" it will be a few bytes more (of sketch size) not 1000 bytes more.