mysql performance tuning innodb_buffer_pool_size and warming the cache (select * vs select count(*))
Warmup

If you have a secondary index on the table, SELECT COUNT(*)... will use that.  So the first "warming" fetched that index.  The second "warming" fetched the data; note that the hump is higher, since the data is bigger?

That is, COUNT(*) works only for an InnoDB table with no secondary keys.

This might work:  SELECT COUNT(*) FROM t FORCE INDEX(PRIMARY);

You are overdue for an upgrade.  With 5.6.3, there is innodb_buffer_pool_dump_at_shutdown and innodb_buffer_pool_load_at_startup, which is better than your warmup script; it efficiently restores the buffer pool to whatever was in it.

Buffer pool size

5GB of data; 32GB of RAM --> 8GB sounds like a good buffer_pool_size:


Less than 5GB probably leads to extra I/O (depending on "working set size").
8GB leaves enough room on top of the 5GB for the "Change Buffer" and other overhead.
8-25GB -- the rest would be idle.
over 25GB -- threaten to do swapping, which would be really bad for performance.