select count(uuid) from records;
Makes absolutely no sense. You know the uuid is unique so you are deliberately selecting a value and then throwing it away just to count it. select count(1) from records;
Would give the same value and could be answered from the index without requiring a scan of the table.This is true of any unique column in the table no matter what type (it doesn’t have to be a uuid). The fact that uuids are a bit slower than other types of keys when you scan the entire table unnecessarily seems beside the point.