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

  • SEARCH
  • Home
  • 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 3341080
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T00:40:54+00:00 2026-05-18T00:40:54+00:00

I have a query that I run once a day that takes certain tables

  • 0

I have a query that I run once a day that takes certain tables from my database and puts them into a single table so that I can quickly export the information in any format I require.

I am running into a problem however that gives me the following error: “SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction”

From what I understand it sounds like my query is trying to get a lock on the table when there already is a lock in place. However I confess that I do not know anything about table locking or how it works.

Really I am just trying to read the other tables and not write to them, is there a way that I can create the query but not request a lock?

My query is ridiculously long so that’s why I did not post it. If there are certain parts that you need let me know and I can post them.

  • 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-18T00:40:55+00:00Added an answer on May 18, 2026 at 12:40 am

    You could try using INSERT DELAYED, here is what it does:

    When a client uses INSERT DELAYED, it gets an okay from the server at once, and the row is queued to be inserted when the table is not in use by any other thread.

    If you are willing to see data in a mixed state, you can change the transaction isolation level

    SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
    -- Problematic SELECT query goes here --
    SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
    

    I learned that one from another SO answer by Jon Erickson

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

Sidebar

Related Questions

I have a query that is run once per minute, on multiple tables (with
I have a java.sql.ResultSet object containg data from a query that was run. How
I have a need for a run once query (so performance isn't that critical)
I have the next query that I run via SQLCMD.EXE use [AxDWH_Central_Reporting] GO EXEC
I have a basic query that I run over and over at each 2
I have the query below that when run it says that 325 rows were
I am using in C# MYsql .I have query that works if I run
I have a custom SQL query that I run with this line: @avg_score =
I have the following Table elements how do i run a query that reproduce
I have a PHP code, that will run a Select query to check if

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.