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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T20:00:28+00:00 2026-05-13T20:00:28+00:00

This may be a silly question, but it may shed some light on how

  • 0

This may be a silly question, but it may shed some light on how joins work internally.

Let’s say I have a large table L and a small table S (100K rows vs. 100 rows).

Would there be any difference in terms of speed between the following two options?:

OPTION 1:                 OPTION 2:
---------                 ---------
SELECT *                  SELECT *
FROM L INNER JOIN S       FROM S INNER JOIN L
ON L.id = S.id;           ON L.id = S.id;

Notice that the only difference is the order in which the tables are joined.

I realize performance may vary between different SQL languages. If so, how would MySQL compare to Access?

  • 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-13T20:00:28+00:00Added an answer on May 13, 2026 at 8:00 pm

    No, the order does not matter.

    Almost all RDBMS’s (such MS Access, MySQL, SQL Server, ORACLE etc) use a cost based optimiser based upon column statistics. In most situations, the optimiser will choose a correct plan. In the example you gave, the order will not matter (provided statistics are up to date).

    To decide what query strategy to use,
    the Jet Engine optimizer uses
    statistics. The following factors are
    some of the factors that these
    statistics are based on:

    • The number of records in a table
    • The number of data pages in a table
    • The location of the table
    • Whether indexes are present
    • How unique the indexes are

    Note: You cannot view Jet database engine optimization schemes, and you
    cannot specify how to optimize a
    query. However, you can use the
    Database Documenter to determine
    whether indexes are present and how
    unique an index is.

    Based on these statistics, the
    Optimizer then selects the best
    internal query strategy for dealing
    with a particular query.

    The statistics are updated whenever a
    query is compiled. A query is flagged
    for compiling when you save any
    changes to the query (or its
    underlying tables) and when the
    database is compacted. If a query is
    flagged for compiling, the compiling
    and the updating of statistics occurs
    the next time that the query is run.
    Compiling typically takes from one
    second to four seconds.

    If you add a significant number of
    records to your database, you must
    open and then save your queries to
    recompile the queries. For example, if
    you design and then test a query by
    using a small set of sample data, you
    must re-compile the query after
    additional records are added to the
    database. When you do this, you want
    to make sure that optimal query
    performance is achieved when your
    application is in use.

    Ref.

    Might be of interest: ACC: How to Optimize Queries in Microsoft Access 2.0, Microsoft Access 95, and Microsoft Access 97

    Tony Toews’s Microsoft Access Performance FAQ is worth reading.

    There’s a caveat to "JOIN order does not matter".

    If your RDBMS’s cost based query optimiser times out creating the query plan then the join order COULD matter. Cost based optimisers have finite resources (both CPU time and memory) in which to construct a query plan. If they time out during the compilation stage, you will get the best plan found so far.

    TLDR; If you have complex queries that receive a plan compilation timeout (not query execution timeout), then put your most restrictive joins first. That way, at the point the query plan optimiser times out, it will increase the chance that a ‘better’ plan was found.

    Of course, if you are experiencing query plan compilation timeouts, you should probably simplify your query.

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

Sidebar

Related Questions

This may be a silly question, but right now I have a rather large
This may be a silly question but... Say you have a sentence like: The
This may be a silly question but... Say I have a String like 4e59
This may seem like a silly question but I can't figure it out. let's
This may be a silly question (but I'm new to multicast). I have a
This may be a silly question to some, but I was curious how would
This may be a silly question, due to missing some understanding of java but
This may be a silly question, but say I want to get two values
I know this may be a silly question. but stil i have a confusion.
I know this may be a silly question for experienced coders. But I have

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.