1) 8.0.28 mysql [localhost:3308] {root} ((none)) > select version()\G; *************************** 1. row *************************** version(): 8.0.28 1 row in set (0.00 sec) mysql [localhost:3308] {root} (sbtest) > SET profiling=1; mysql [localhost:3308] {root} (sbtest) > PAGER md5sum; PAGER set to 'md5sum' mysql [localhost:3308] {root} (sbtest) > select * from sbtest.sbtest1 where id = 50000; 042b545c5456e609962223e34808f576 - 1 row in set (0.00 sec) mysql [localhost:3308] {root} (sbtest) > NOPAGER; PAGER set to stdout mysql [localhost:3308] {root} (sbtest) > SHOW PROFILES; +----------+------------+-----------------------------------------------+ | Query_ID | Duration | Query | +----------+------------+-----------------------------------------------+ | 1 | 0.00084100 | select * from sbtest.sbtest1 where id = 50000 | | 2 | 0.00045775 | select * from sbtest.sbtest1 where id = 50000 | | 3 | 0.00069800 | select * from sbtest.sbtest1 where id = 50000 | | 4 | 0.00056075 | select * from sbtest.sbtest1 where id = 50000 | | 5 | 0.00044550 | select * from sbtest.sbtest1 where id = 50000 | | 6 | 0.00074625 | select * from sbtest.sbtest1 where id = 50000 | | 7 | 0.00050175 | select * from sbtest.sbtest1 where id = 50000 | | 8 | 0.00070075 | select * from sbtest.sbtest1 where id = 50000 | | 9 | 0.00051550 | select * from sbtest.sbtest1 where id = 50000 | | 10 | 0.00074475 | select * from sbtest.sbtest1 where id = 50000 | +----------+------------+-----------------------------------------------+ => 0.006212 mysql [localhost:3308] {root} (sbtest) > SET profiling=0; mysql [localhost:3308] {msandbox} (sbtest) > select sum(id)from sbtest1; +------------+ | sum(id) | +------------+ | 5000050000 | +------------+ 1 row in set (0.04 sec) mysql [localhost:3308] {msandbox} (sbtest) > select sum(id)from sbtest1; +------------+ | sum(id) | +------------+ | 5000050000 | +------------+ 1 row in set (0.03 sec) mysql [localhost:3308] {msandbox} (sbtest) > select sum(id)from sbtest1; +------------+ | sum(id) | +------------+ | 5000050000 | +------------+ 1 row in set (0.03 sec) 2) 8.0.36 mysql [localhost:8035] {msandbox} ((none)) > select version()\G; *************************** 1. row *************************** version(): 8.0.36-28 mysql> SET profiling=1; mysql> PAGER md5sum; mysql> select * from sbtest.sbtest1 where id = 50000; ### repeat the query 10-20 times mysql> NOPAGER; mysql> SHOW PROFILES; mysql [localhost:8035] {msandbox} ((none)) > SHOW PROFILES; +----------+------------+-----------------------------------------------+ | Query_ID | Duration | Query | +----------+------------+-----------------------------------------------+ | 1 | 0.00062075 | select * from sbtest.sbtest1 where id = 50000 | | 2 | 0.00055775 | select * from sbtest.sbtest1 where id = 50000 | | 3 | 0.00080400 | select * from sbtest.sbtest1 where id = 50000 | | 4 | 0.00079650 | select * from sbtest.sbtest1 where id = 50000 | | 5 | 0.00087125 | select * from sbtest.sbtest1 where id = 50000 | | 6 | 0.00084175 | select * from sbtest.sbtest1 where id = 50000 | | 7 | 0.00057850 | select * from sbtest.sbtest1 where id = 50000 | | 8 | 0.00072250 | select * from sbtest.sbtest1 where id = 50000 | | 9 | 0.00074350 | select * from sbtest.sbtest1 where id = 50000 | | 10 | 0.00081900 | select * from sbtest.sbtest1 where id = 50000 | +----------+------------+-----------------------------------------------+ => 0.0073555 mysql> SET profiling=0; mysql [localhost:8035] {msandbox} (sbtest) > select sum(id)from sbtest1; +------------+ | sum(id) | +------------+ | 5000050000 | +------------+ 1 row in set (0.06 sec) mysql [localhost:8035] {msandbox} (sbtest) > select sum(id)from sbtest1; +------------+ | sum(id) | +------------+ | 5000050000 | +------------+ 1 row in set (0.03 sec) mysql [localhost:8035] {msandbox} (sbtest) > select sum(id)from sbtest1; +------------+ | sum(id) | +------------+ | 5000050000 | +------------+ 1 row in set (0.04 sec) 3) 8.0.37 mysql [localhost:3309] {msandbox} (sbtest) > select version()\G; *************************** 1. row *************************** version(): 8.0.37 1 row in set (0.00 sec) mysql [localhost:3309] {msandbox} (sbtest) > SET profiling=1; Query OK, 0 rows affected, 1 warning (0.00 sec) mysql [localhost:3309] {msandbox} (sbtest) > PAGER md5sum; PAGER set to 'md5sum' mysql [localhost:3309] {msandbox} (sbtest) > select * from sbtest.sbtest1 where id = 50000; 042b545c5456e609962223e34808f576 - 1 row in set (0.00 sec) mysql [localhost:3309] {msandbox} (sbtest) > select * from sbtest.sbtest1 where id = 50000; 042b545c5456e609962223e34808f576 - 1 row in set (0.01 sec) mysql [localhost:3309] {msandbox} (sbtest) > select * from sbtest.sbtest1 where id = 50000; 042b545c5456e609962223e34808f576 - 1 row in set (0.01 sec) mysql [localhost:3309] {msandbox} (sbtest) > select * from sbtest.sbtest1 where id = 50000; 042b545c5456e609962223e34808f576 - 1 row in set (0.00 sec) mysql [localhost:3309] {msandbox} (sbtest) > select * from sbtest.sbtest1 where id = 50000; 042b545c5456e609962223e34808f576 - 1 row in set (0.01 sec) mysql [localhost:3309] {msandbox} (sbtest) > select * from sbtest.sbtest1 where id = 50000; 042b545c5456e609962223e34808f576 - 1 row in set (0.00 sec) mysql [localhost:3309] {msandbox} (sbtest) > select * from sbtest.sbtest1 where id = 50000; 042b545c5456e609962223e34808f576 - 1 row in set (0.00 sec) mysql [localhost:3309] {msandbox} (sbtest) > select * from sbtest.sbtest1 where id = 50000; 042b545c5456e609962223e34808f576 - 1 row in set (0.00 sec) mysql [localhost:3309] {msandbox} (sbtest) > select * from sbtest.sbtest1 where id = 50000; 042b545c5456e609962223e34808f576 - 1 row in set (0.00 sec) mysql [localhost:3309] {msandbox} (sbtest) > select * from sbtest.sbtest1 where id = 50000; 042b545c5456e609962223e34808f576 - 1 row in set (0.01 sec) mysql [localhost:3309] {msandbox} (sbtest) > NOPAGER; PAGER set to stdout mysql [localhost:3309] {msandbox} (sbtest) > SHOW PROFILES; +----------+------------+-----------------------------------------------+ | Query_ID | Duration | Query | +----------+------------+-----------------------------------------------+ | 1 | 0.00084900 | select * from sbtest.sbtest1 where id = 50000 | | 2 | 0.00089525 | select * from sbtest.sbtest1 where id = 50000 | | 3 | 0.00089100 | select * from sbtest.sbtest1 where id = 50000 | | 4 | 0.00084400 | select * from sbtest.sbtest1 where id = 50000 | | 5 | 0.00077675 | select * from sbtest.sbtest1 where id = 50000 | | 6 | 0.00050575 | select * from sbtest.sbtest1 where id = 50000 | | 7 | 0.00056075 | select * from sbtest.sbtest1 where id = 50000 | | 8 | 0.00050675 | select * from sbtest.sbtest1 where id = 50000 | | 9 | 0.00079175 | select * from sbtest.sbtest1 where id = 50000 | | 10 | 0.00107400 | select * from sbtest.sbtest1 where id = 50000 | +----------+------------+-----------------------------------------------+ 10 rows in set, 1 warning (0.00 sec) => 0.007695 mysql [localhost:3309] {msandbox} (sbtest) > SET profiling=0; mysql [localhost:3309] {msandbox} (sbtest) > select sum(id)from sbtest1; +------------+ | sum(id) | +------------+ | 5000050000 | +------------+ 1 row in set (0.04 sec) mysql [localhost:3309] {msandbox} (sbtest) > select sum(id)from sbtest1; +------------+ | sum(id) | +------------+ | 5000050000 | +------------+ 1 row in set (0.05 sec) mysql [localhost:3309] {msandbox} (sbtest) > select sum(id)from sbtest1; +------------+ | sum(id) | +------------+ | 5000050000 | +------------+ 1 row in set (0.03 sec)