Home » SQL & PL/SQL » SQL & PL/SQL » Driving Table (Oracle 10g)
Driving Table [message #383259] Wed, 28 January 2009 00:53 Go to next message
raopapa
Messages: 10
Registered: January 2009
Junior Member
hi,

i have a join like this

select a.col,b.col,c.col
from a,b,c
where a.col = b.col
and b.col = c.col

how oracle knows which is driving table in the above.

pl give me a answer.

Paparao
Re: Driving Table [message #383263 is a reply to message #383259] Wed, 28 January 2009 00:58 Go to previous messageGo to next message
Michel Cadot
Messages: 64132
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Oracle build his execution from statistics.
It knows the driving table from them.

Regards
Michel
Re: Driving Table [message #383265 is a reply to message #383259] Wed, 28 January 2009 00:59 Go to previous messageGo to next message
BlackSwan
Messages: 25047
Registered: January 2009
Location: SoCal
Senior Member
driving table is one on the right
Re: Driving Table [message #383275 is a reply to message #383265] Wed, 28 January 2009 01:15 Go to previous messageGo to next message
raopapa
Messages: 10
Registered: January 2009
Junior Member
i think before 9i the one from right is the drivng table...in oracle 10g also same rule.
Re: Driving Table [message #383281 is a reply to message #383275] Wed, 28 January 2009 01:23 Go to previous messageGo to next message
Michel Cadot
Messages: 64132
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Michel Cadot wrote on Wed, 28 January 2009 07:58
Oracle build his execution from statistics.
It knows the driving table from them.

Regards
Michel


Re: Driving Table [message #383282 is a reply to message #383259] Wed, 28 January 2009 01:23 Go to previous messageGo to next message
BlackSwan
Messages: 25047
Registered: January 2009
Location: SoCal
Senior Member
>.in oracle 10g also same rule.
Since when in V10 did Oracle support RBO (rule)?
V10 did/does CBO (Cost Base Optimizer).

When was CBO obsoleted & retired?
Re: Driving Table [message #383427 is a reply to message #383259] Wed, 28 January 2009 18:59 Go to previous messageGo to next message
Barbara Boehmer
Messages: 8635
Registered: November 2002
Location: California, USA
Senior Member
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:192812348072
Re: Driving Table [message #383429 is a reply to message #383259] Wed, 28 January 2009 20:15 Go to previous message
Kevin Meade
Messages: 2101
Registered: December 1999
Location: Connecticut USA
Senior Member
why do you ask?

Driving table "first table accessed"

CBO uses indexes and hueristics to determine driving table. Table furthest to the right is a last resort used only when two or more tables net out equal after evaluation of indexes and hueristics rules. Indeed, it is usually not the last table in the from clause which is the table furthest to the right for the entire query. A nested select cound even become the driving table in some situations.

RBO uses statistics based plan evaluation to pick the best plan from many. What ever plan the RBO picks, first table accessed could be considered driving table but it is pretty much irrelevant at this point.

Kevin
Previous Topic: SQL Query Fast and Efficient (merged 5)
Next Topic: how to simplify the following trigger code
Goto Forum:
  


Current Time: Wed Dec 07 14:49:13 CST 2016

Total time taken to generate the page: 0.05365 seconds