What are the side effects of MySQL pure function sql?

there is a need for to find the same current week as mysql for other purposes

SELECT DATE_FORMAT(NOW(), "%v") - 1 AS currentWeek

this is written by another person. I"m thinking about implementing this requirement in code. What I"m worried about: speed, it doesn"t seem slow to execute pure function sql; it"s dependent on mysql.

Jun.14,2022

production environment is not recommended.
takes up the number of connections, increases the pressure on the database, and takes up various resources (CPU, network, memory).

of course, these data are small, depending on your specific situation.
generally, production environments guarantee time synchronization between different servers, so any server can take this value.


the database had better only do simple operations such as data insertion and query, and the logical operation is done by the application.

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