Mysql avg optimization

use mysql avg to find the average of a floating-point field of a table. The execution time of 200000 data is about 0.5 seconds. This field has no index, and where is indexed. How to optimize such a table? 200000 is just a test, and the actual amount of statistical data at a time is about 3 million rows.

Apr.03,2021
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3a72c-4ee7b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3a72c-4ee7b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?