Which database type for log analysis?
You need several of my blogs:


Why UUIDs can be very slow - Do you need a UUID?
How to efficiently purge "older than X days" using PARTITIONing;
Incrementally augmenting a Summary Table, though you may have this 'right'.


How big is the table?  Which Engine are you using?  What is the value of innodb_buffer_pool_size?  It should be about 70% of RAM.