Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1066049
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T19:57:27+00:00 2026-05-16T19:57:27+00:00

I have something like 40K rows and i must run update query like this:

  • 0

I have something like 40K rows and i must run update query like this:

UPDATE table1 
 SET column1='very long value 1...', column2='normal lenght value 1a'
WHERE pid ='123' and column3='ccc';

column1 is TEXT

column2 is Varchar(150)

…and i want to use mysql query what is more server resource friendly.

I want to use something like that:

UPDATE table1 
   CASE pid
    WHEN '123' THEN 'very long value 1...' 
    WHEN '124' THEN 'very long value 2...'  
    WHEN '543' THEN 'very long value 4...'  
    ...
    WHEN pid='34532' THEN 'very long value 5...'
    ELSE column1 
   END,
   column2= 
   CASE pid
    WHEN '123' THEN 'normal lenght value 1a'
    WHEN '124' THEN 'normal lenght value 2a'
    WHEN '543' THEN 'normal lenght value 4a'
    ...
    WHEN pid='34532' THEN 'normal lenght value 5a'
    ELSE column2 
   END
WHERE pid IN ('123','124','543', ...,'34532') AND column3='ccc';

and my question is how many rows i can update in this way in one query?

Is there other server resource friendly method to update this 40K rows?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T19:57:27+00:00Added an answer on May 16, 2026 at 7:57 pm

    i think that it does not depend on the number of rows but the query size !

    the size of one query its depend in the parameter

    max_allowed_packet

    http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html#sysvar_max_allowed_packet

    to increase this u can look at :

    http://dev.mysql.com/doc/refman/5.1/en/packet-too-large.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have something like this: barProgress.BeginAnimation(RangeBase.ValueProperty, new DoubleAnimation( barProgress.Value, dNextProgressValue, new Duration(TimeSpan.FromSeconds(dDuration))); Now, how
I have something like this: <node TEXT= txt A /> <node TEXT= txt X
I have something like this: <div class=content> <a href=#>A</a> </div> <div class=content> <a href=#>B</a>
So I have something like this: var xmlStatement:String = xmlObject.node[3].@thisValue; What mystery function do
It is typical to have something like this in your cshrc file for setting
If I have something like a loop or a set of if/else statements, and
If I have something like a UILabel linked to a xib file, do I
Is it possible to have something like a JTextArea which will color some keywords
it appears if you have something like var my_var = {foo : bar}; in
If you have something like: val myStuff = Array(Person(joe,40), Person(mary, 35)) How do you

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.