Couple of questions on datat types and performance
1. varchar vs varchar(2)
I created a database schema and based on the test data I had to work with,
I couldn't really determine the max size of a lot of string fields so I
just left a lot of fields as varchar
A comment from a coworker was that this would cause a performance problem
Based on the docs, they say that there's not performance difference between
using varchar(n) and text.
So will leaving my fields as unlimited varchar be a performance issue? Or
should I try to narrow them down?
My coworker has more experience with Oracle and MS-SQL than postgresql
2.varchar and int
I was using a varchar as one field that's part of an index. Looking at the
data, I realized I could just use an int instead. My assumption would be
that an int would be faster to serach for thena varchar, so I converted
the field to int. Is this a valid assumption?
Thanks