Manual merge of low-cardinality index optimization from post-4.6 master