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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T19:12:05+00:00 2026-06-09T19:12:05+00:00

the scripts i’ve been working with in SQL work with close to 40,000 records

  • 0

the scripts i’ve been working with in SQL work with close to 40,000 records and i’ve noticed a huge increase in execution time for when i use an UPDATE command

in 2 tables that have like 10 fields in them each, INSERT executes quicker for both combined than this UPDATE command

UPADTE table1
INNER JOIN table2 ON table1.primarykey = table2.primarykey
SET table1.code = table2.code

really what the UPDATE is doing is copying the code from one table to another where the identical records exists, this is because table1 is a staging table between 2 databases while table2 is a possessing table to insert staging table’s data across multiple tables, both tables have the same number of record which is about 40,000

now to me UPDATE should be executing a lot quicker, considering it’s only connecting 2 identical tables and inserting data for 1 field it should be running quicker than 2 INSERTS where 40,000 records are being created over 10 fields (so in other words, inserting 800,000 pieces of data) and i’m running the queries in a SQL console windows to avoid php timeouts

is UPDATE somehow more resource hungry than INSERT and is there any way to get it to go faster (apart from changing the fact that i use a separate table for processing, the staging table updates frequently so i copy the data like a snapshot and work with that, the code field is NULL to begin with so i only copy over records with a NULL code meaning records where code is not NULLhave already been worked with)

  • 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-09T19:12:07+00:00Added an answer on June 9, 2026 at 7:12 pm

    Is that UPDATE command the actual SQL? Because you need a WHERE clause to avoid updating every record in the table…

    Also, INSERT doesn’t first need to find the record to update from 2 joined tables.

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

Sidebar

Related Questions

While testing some scripts, I've noticed, if expiration time is little (not zero) -
I have come across scripts that use: isset($_POST['submit']) as well as code that uses:
When developing Pig scripts that use the STORE command I have to delete the
Scripts, registries, screen-savers, oh my! I'm trying to use a screen-saver on a Windows
writing scripts for Sql Server 2005. I am registering a schema with CREATE XML
Problem Scripts on some pages that use jquery are not activating. Scenario Finding that
When I write larger scripts in both t-sql and script components, I usually put
I have a few scripts that clean-up some of the sites I use. But,
There are some scripts that do not work correctly if they check for changes.
Bash scripts are very useful and can save a lot of programming time. So

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.