Speeding up count(distinct) of one column based on condition on other column in MySQL
问题 I have a MySQL table of 10 million rows and 3 columns, in following format: +---------------------------------------------------------------------------------------+ | id time num | +---------------------------------------------------------------------------------------+ | ca65e871-d758-437e-b76f-175234760e7b 2020-11-14 23:08:05.553770 11112222222 | | ... | +---------------------------------------------------------------------------------------+ For running the first query below, I indexed