Description
create index ix5 on `beer-sample`(city);
select count from `beer-sample` where city = "Portland";
Above query does index scan, but ti also does KV operation due to STAR as count operand.
Consider this is special case of count(1) we can eliminate the KV operation. After change query become covered we may be able to use Index Scan count.
Attachments
For Gerrit Dashboard: MB-18563 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
61123,2 | Fix MB-18563. Push COUNT(*) and COUNT(1) down to index. Do not push down COUNT(index_key), so that NULLs are skipped by the count. | master | query | Status: MERGED | +2 | +1 |
61157,2 | Fix MB-18563. Fix bug in previous checkin. Require actual COUNT() aggregate. | master | query | Status: MERGED | +2 | +1 |