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 8079619
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T16:09:50+00:00 2026-06-05T16:09:50+00:00

I have table with around 70 000 rows. There is 6000 rows that i

  • 0

I have table with around 70 000 rows. There is 6000 rows that i need to find, change, and save (i must do this often, few tiems a week). Curently, i am doing it like this, and it las more than 2 minutes to finish: (any advice? 🙁 )

  $query = mysql_query("SELECT meta_value FROM my_table WHERE meta_key = 'key' AND meta_value LIKE '%something%'")or die(mysql_error());

  $new = "soemthing something";

  while($row = mysql_fetch_array($query)){

    $old = unserialize($row['meta_value']);
    $new_meta_r = str_replace($old['color'],$new,$old);
    $new_meta = serialize($new_meta_r);

    $update_meta = mysql_query("UPDATE my_table SET meta_value = '$new_meta' WHERE meta_key = 'key' AND meta_value LIKE '%something%'")or die(mysql_error());
  }
  • 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-06-05T16:09:52+00:00Added an answer on June 5, 2026 at 4:09 pm

    Here are some ways that can help optimizing :

    • Try getting the ID besides the meta_value , and when using update just reffering to the ID.
    • Check if you really need to use the entire wildcard or you can make it post or prefixed.

    Meaning :

    #Full wildcard  
    
     SELECT * FROM TABLE WHERE COLUMN LIKE '%something%';  
    
    #Postfix wildcard  
    
     SELECT * FROM TABLE WHERE COLUMN LIKE  'something%';  
    
     #Prefix wildcard  
    
    SELECT * FROM TABLE WHERE COLUMN LIKE  '%something'; 
    
    • Make sure you’re using the right data types, that varchars are the right size, using int instead of BigInt, etc.
    • Try moving the query to a Stored Procedure, Stored Procedures are compiled (SQL Code is not), making them faster than SQL code.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table with around 100,000 rows at the moment. I want to
We have a table in our database which has around 2,500,000 rows (around 3GB).
I have a social network The users table is around 60,000 rows The friends
I have a big table (200'000'000 rows); declared like this thread( forum_id tinyint, thread_id
I have a table with around 40 million rows, and I want to run
I have a large table with around half a million rows which is taking
I'm having an issue bending my head around this one. I have a table
OK I have a social network, around 50,000 users so far and there is
I currently have 2 tables, one is idtracker which has around 30,000 rows and
Let's assume that I have a table with two columns A and B. There

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.