cancel
Showing results for 
Search instead for 
Did you mean: 

Different execution plan for the same sql statement

Former Member
0 Kudos

Hi all,

When I check the same sql statement in different systems,   P system and Q system.

It shows different execution plan for inner join

Sql statement


Excution plan

For system P    the value of MANDT is 1     table EKPO accessed first with full table scan.

For system Q    the value of MANDT is 4     table EKKO accessed first with index EKKO~1(in P also has this index)

Data volume in Q is a little bit larger than P.

Could you please help to find out why there is such a difference?  which one is correct?

How the optimizer works when process the inner join for maxDB?

Thanks & Regards,

Chris

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

Hello Chris,

Check if the statistics are up to date on these tables - Perform and UPDATE STATISTICS for the tables and then compare the execution plan.


More information see SAP Note - 1368477 - FAQ: SAP MaxDB Queryrewrite

Regards,

Yashwanth