Joao wrote:

> In Database Documentation I Have seen that the strategy used 
> by database
> engine is independent of the order that i put the tables... 
> but... something
> is making me feel confused.
> 
> That is the situation (a simplified version):
> 
> T1 = 10000 Records
> T2 = 1000000 Recods
> 
> Index on T1.x
> Index on T2.x
> Index on T2.y
> 
> Case 1 :
> Select * from T1, T2 where T1.x=T2.x and T2.y = 'AAA'
> Srategy used...
> 1 - Table Scan  T1
> 2 - Index Seek T2
> ....
> 
> Case 2 : (only changing the order T1, T2)
> Select * from T2, T1 where T1.x=T2.x and T2.y = 'AAA'
> Srategy used...
> 1 - Index Seek T2
> 2 - Index Seek T1
> ....
> 
> Can anyone explain it to me ?
> 
> another thing :
> 
> Excepting the join clause the rest of where clause is 
> composed dinamicaly by
> user... so the user can filter by fields in T1 as in T2 ... 
> so I canot force
> the order of tables in select...
> 
> Any sugestion ?

Hi,

in general the order of the tables in the from clause have 
no influence on the execution strategy but there is one 
exception in MaxDB. 

For outer joins MaxDB executes the join in order given by
the from clause. We are working on that restriction and you 
can already disable it with:
  
  "dbmcli -d <dbname> -u <user,pwd> util_execute diagnose optimize join outer off"

So is it possible that your not simplified command is an 
outer join statement?

If not I'm very interested in the output of "explain sequence <select>"
of both statements.

Kind regards,
Holger
SAP Labs Berlin

-- 
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to