I have a table with 5M rows, the table contains lab observation codes and display names, both columns have type varchar(2000) and both are indexed.
The query looks like:
select code_1_text, count(code_1_text)
from demo.observation_lab
group by code_1_text
order by 2 desc
The table contains ~1000 distinct display names.
It takes 4 minutes for the query to complete on a VM with some pretty old Xeon, 4 cores, 32G RAM, NVME SSD and Linux on board.