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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T15:16:41+00:00 2026-06-09T15:16:41+00:00

I have a completely blank custom table (DatabaseLogFixLog) with only one field/column called refRecId.

  • 0

I have a completely blank custom table (DatabaseLogFixLog) with only one field/column called “refRecId”. I am joining it to SysDatabaseLog (log). The plan is to update SysDatabaseLog in batches, and as I update the SysDatabaseLog, I’ll insert the recId of the row I updated. My SysDatabaseLog has 3.7 million records in it. I have tried both notexists join and outer join seen below. What’s wrong with my code? Both just completely lock up my system, and the debugger will not get inside the loops.

Outer join:

updateCounter = 10;
while select forupdate log
    order by CreatedDateTime, RecId
    outer join databaseLogFixLog
    where databaseLogFixLog.RefRecId != log.RecId
{
    counter++;

    if (counter > updateCount)
        break;

    info(strfmt("%1", counter));
}

info(strfmt("Done updating %1", counter));

Notexists join:

updateCounter = 10;
while select forupdate log
    order by CreatedDateTime, RecId
    notexists join databaseLogFixLog
    where databaseLogFixLog.RefRecId == log.RecId
{
    counter++;

    if (counter > updateCount)
        break;

    info(strfmt("%1", counter));
}

info(strfmt("Done updating %1", counter));
  • 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-09T15:16:42+00:00Added an answer on June 9, 2026 at 3:16 pm

    Your two joins are not equivalent, your outer join is just plain wrong.

    You exists join will work, but it will have to sort your log records (3.7 million), witch will take some time. Also it have to check for the whether you logFixLog record exist (for each of the 3.7 million), you will need an index on the RefRecId field to speed things up.

    If you want speed then remove the order by clause.

    You could also try the adding the firstfast keyword, it will sometimes giver faster initial results (but rarely if combined with order by).

    Finally, select the fields you want to update, especially avoid the container field as this field is not stored with the other fields.

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

Sidebar

Related Questions

I have a completely blank .aspx file residing on an IIS6 web server. The
I have a custom table cell which contains a number of UILabels. At runtime,
I have to admit I am COMPLETELY stumped on this one. I've been scouring
I have a FormView where I pull data from one table (MS Access), and
I have a created a custom ArrayAdapter to hold a tuple. I use one
I have installed a complete blank theme with no CSS in my new wordpress
Note I have completely re-written my original post to better explain the issue I
I am working on some homework here, but I have completely run out of
My application has several independent top-level windows, which all have completely different functions/workflows. I
I have a completely empty RavenHQ database that's linked to my Appharbor application. The

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.