How is PostgreSQL indexing strings and varchars?
Is it indexing the full "string" or only parts of it?
Until now I've assumed that it's using the full string, but never really got it verified.
It uses the whole string. If you want to use only a part of a string you can always use an index on an expression. Like:
CREATE INDEX some_idx ON tbl (left(col, 10));
left() requires PostgreSQL 9.1 or later. For older versions:
CREATE INDEX some_idx ON tbl (substr(col, 1,10));