index cleanup (inspired by postgres-friendliness)
lots of smaller postgres-related fixes