Index Only Scan using ab_a_b_idx on ab (cost=0.15..66.87 rows=2260 width=8)
(1 row)
This index, as we've defined it should not be able to satisfy the query's order by, although it does give correct results, that's because the index seems to be built wrongly in cases where the rows are added after the index exists.