I was just thinking… the aim here is to get things in chronological order, right? Looking at the YYYY-MM-DDTHH:MM:SS format of ISO8601 dates, I think you can actually get away with sorting them ‘alphabetically’, and it will still be chronological.
Without the cast, I think postgres should be able to use the index we have on (name, value), and it should be much more efficient.