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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T11:21:59+00:00 2026-06-09T11:21:59+00:00

The following query is timing out after 600 seconds. update placed p ,Results r

  • 0

The following query is timing out after 600 seconds.

update placed p
      ,Results r
  set p.position = r.position
  where p.competitor = r.competitor
    AND p.date = r.date 
    AND REPLACE(p.time,":","") = r.time; 

The structure is as follows:

'CREATE TABLE `placed` (
  `idplaced` varchar(50) DEFAULT NULL,
  `date` decimal(8,0) DEFAULT NULL,
  `time` varchar(45) DEFAULT NULL,
  `field1` varchar(45) DEFAULT NULL,
  `competitor` varchar(45) DEFAULT NULL,
  `field2` int(2) DEFAULT NULL,
  `field3` varchar(45) DEFAULT NULL,
  `field4` varchar(45) DEFAULT NULL,
  `field5` decimal(6,2) DEFAULT NULL,
  `field6` decimal(10,2) DEFAULT NULL,
  `field7` decimal(6,2) DEFAULT NULL,
  `field8` char(1) DEFAULT NULL,
  `field9` varchar(45) DEFAULT NULL,
  `position` char(4) DEFAULT NULL,
  `field10` decimal(6,2) DEFAULT NULL,
  `field11` char(1) DEFAULT NULL,
  `field12` char(1) DEFAULT NULL,
  `field13` decimal(6,2) DEFAULT NULL,
  `field14` decimal(6,2) DEFAULT NULL,
  `field15` decimal(6,2) DEFAULT NULL,
  `field16` decimal(6,2) DEFAULT NULL,
  `field17` decimal(6,2) DEFAULT NULL,
  `field18` char(1) DEFAULT NULL,
  `field19` char(20) DEFAULT NULL,
  `field20` char(1) DEFAULT NULL,
  `field21` char(5) DEFAULT NULL,
  `field22` char(5) DEFAULT NULL,
  `field23` int(11) DEFAULT NULL
   PRIMARY KEY (`idplaced`),
  UNIQUE KEY `date_time_competitor_field18_combo` (`date`,`time`,`competitor`,`field18`)
) ENGINE=InnoDB AUTO_INCREMENT=100688607 DEFAULT CHARSET=latin1;

CREATE TABLE `results` (
  `idresults` int(11) NOT NULL AUTO_INCREMENT,
  `date` char(8) DEFAULT NULL,
  `time` char(4) DEFAULT NULL,
  `field1` varchar(45) DEFAULT NULL,
  `competitor` varchar(45) DEFAULT NULL,
  `position` char(4) DEFAULT NULL,
  `field2` varchar(45) DEFAULT NULL,
  `field3` decimal(2,0) DEFAULT NULL,
  PRIMARY KEY (`idresults`)
) ENGINE=InnoDB AUTO_INCREMENT=6644 DEFAULT CHARSET=latin1;

The PLACED table has 65,000 records, the RESULTS table has 9,000 records.

I am assuming the solution involves a JOIN statement of some descript, and I have tried taking several suggestions from this site, but am simply not finding the answer I am looking for. Simply put, I would be grateful for suggestions on this. I can put up example tables / create table code if requried.

  • 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-09T11:22:01+00:00Added an answer on June 9, 2026 at 11:22 am

    The index cannot be used efficiently to perform the join because of your REPLACE operation.
    I’d suggest creating an index with the columns in the following slightly different order:

    (date, competitor, time, position)
    

    It may also help to add this index on both tables.

    It would be even better if you could modify the data in the database so that the data in the time column was stored in the same format in both tables.

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

Sidebar

Related Questions

The following query does not update the datetime field: update table SET EndDate =
The following query is taking more than 25 seconds to complete: SELECT c.* ,
The following query is taking more than 20 seconds to execute on a table
The following query works, but its very slow for 10 records (2 seconds). The
I have a PHP Script with the following code: $sql = UPDATE tbl_p2e_place SET
The following query takes 25 seconds with 2 table joins. The first posts table
The following query, when executed in AdventureWords and tempdb , will give different results.
The following query is giving me differing results on different rows and it should
The following query gets all the results from a table called video SELECT video.*
The following query is working as expected. But how do I get the results

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.