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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T07:43:30+00:00 2026-05-21T07:43:30+00:00

The documentation page for INSERT … SELECT states that for INSERT … SELECT to

  • 0

The documentation page for INSERT … SELECT states that for INSERT ... SELECT to work with replication, an ORDER BY some column must be used so that rows may be inserted in a predictable order, therefore auto-increment columns will function correctly.

This has me wondering… when you do an ORDER BY and the column you pick is non-unique, what does MySQL use to decide further ordering? It must be deterministic, otherwise the documentation would say that you need to choose an ORDER BY unique column, yes? Or is the documentation wrong?

  • 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-21T07:43:31+00:00Added an answer on May 21, 2026 at 7:43 am

    If you use an ORDER BY with a column which does not have distinct values for all matched rows, the order is nondeterminstic, yes.

    This does break statement-based replication, IF the inserted order matters. The inserted order certainly matters if you use an auto_increment column in the destination table, but often doesn’t otherwise.

    Order also matters if you have a LIMIT on the statement (update and delete too).

    However, if you use row-based replicaiton you can do pretty much anything you like and not break replication. At least, not unless you really try.


    These rules are so complicated, that I recommend that you just ALWAYS use a completely determinstic ORDER BY on an insert… select, or an UPDATE with a LIMIT.

    Row-based replication is also your friend. I’ve not really used it much in production, but understand that

    • It is more similar to how replication works in other databases
    • Most of the time it Just Works.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The Google Storage documentation page states that You can use a CNAME redirect only
At the documentation page of HaXml ( here ), everywhere used type i ,
In the search_config documentation page, I see that there's something that looks like it
On the documentation page for Equal we read that Approximate numbers with machine precision
Reading the documentation page of BugTracker.NET BugTracker.NET API Documentation I realized that I need
The external MSDN documentation page for types that have NO generic arguments can be
Can anyone point me in the direction of a documentation page for jQuery's AjaxUpload()
This page in the Android documentation defines an element id as follows: <TextView android:id=@+id/label
From this page: http://www.doctrine-project.org/documentation/manual/1_2/en/working-with-models#dealing-with-relations:creating-related-records You can see that it says $obj['property']; is the recommended
Documentation: https://developers.facebook.com/docs/achievements/ Each achievement must possess a unique URL with the appropriate Open Graph

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.