Might be nice to parameterize this and test when an index may be used. Is that code path tested?