Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

207
Views
Mysql2 UPDATE query is taking too much time to update row

I am updating a row in MySQL database using UPDATE keyword (in an express server using mysql2). If the data I am using to update and the data in the row are same then it is taking time as usual. But if I update the table with different data then it takes longer time. There is my code below.

    public update = async (
    obj: TUpCred,
    ): Promise<ResultSetHeader> => {
        const sql = 'UPDATE ?? SET ? WHERE ?';

        const values = [obj.table, obj.data, obj.where];
        const [data] = (await this.connection.query({
            sql,
            values,
        })) as TResultSetHeader;

    return data;
    };

Then this query takes so long time. Usually it is taking 4 - 6 seconds but sometimes it even takes 10 to 15 seconds to update. The same happens with INSERT query. But other queries like SELECT is taking normal time to execute.

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!