The problem of ranking goods according to weight?

many goods. According to the sort, sales volume, collection volume and price of the goods. The four fields correspond to different weight values. Now after writing, the interface returns too slowly for more than 10 seconds to return. How to write it more efficiently?

Php
Jun.07,2022

add a weight field.
add different numerical corresponding values to different things, then increase or decrease the values when the corresponding events occur, and then sort by numerical values.


create a table statement and paste it with sql

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-1b3f3ff-2bcc6.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-1b3f3ff-2bcc6.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?