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.

Menu