Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2009

    Unanswered: order of tables in from

    Does the order of tables in the FROM clause matter to db2? If I have:

    from t1, t2, t3
    where .....

    Does db2 access t1, then t2, and t3?

  2. #2
    Join Date
    Feb 2004
    In front of the computer
    Provided Answers: 54
    There isn't any guaranteed connection between the order in which you list the tables in the FROM clause and the order in which the execution plan will access those tables. One of the things that a database does far better than any human I've met is to organize and manage the data that is in the database... It keeps track of what is where, and figures out how to connect those pieces to get you the information that you want/need as efficiently as it can.

    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

  3. #3
    Join Date
    Dec 2007
    Richmond, VA
    Provided Answers: 5
    Many years ago, you could influence an access with the order of tables in the FROM clause. It is not supposed to any longer. If you do find a query that just by reordering the tables in the FROM clause gets you a different access path the Optimizer team would be very interested in seeing it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts