PostgreSQL index for row type
1 answer
It uses the entire string. If you only want to use part of a string, you can always use an index for the expression . How:
CREATE INDEX some_idx ON tbl (left(col, 10));
left()
requires PostgreSQL 9.1 or newer. For older versions:
CREATE INDEX some_idx ON tbl (substr(col, 1,10));
+8
source to share