Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Joins versus Views

karol_seman
Active Participant
0 Kudos

Hi All,

I need to solve one general performance issue. I have many select statements using joins. All the select statements use primary keys or index access (no grouping, no sorting), so I guess the performance should be the maximum what is possible to do. But customer is still not satisfied - for example waiting one minute for the results from select statement matching mara, makt and kssk.

So my idea was to create some new dictionary views matching these tables and then just use simple select statement from that views. The question is: "Is it good idea and will this lead to better performance?". If not do you have any other suggestions? I can put also some codings here tomorrow ...

Thank you for all your answers,

Karol

1 ACCEPTED SOLUTION

former_member181995
Active Contributor
0 Kudos

It depends.

For more descriptive and informative results of join vs select just refer:

[JOINS vs. FOR ALL ENTRIES - Which Performs Better?|https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/6050] [original link is broken] [original link is broken] [original link is broken];

10 REPLIES 10

former_member181995
Active Contributor
0 Kudos

It depends.

For more descriptive and informative results of join vs select just refer:

[JOINS vs. FOR ALL ENTRIES - Which Performs Better?|https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/6050] [original link is broken] [original link is broken] [original link is broken];

Former Member
0 Kudos

Hi,

Well which is views also use joins internally to fetch data.

Use for all entries than using joins.

Thanks,

Krishna...

0 Kudos

Hi,

why?

See the mentioned discussion!

DO 100 times.

   write: Joins are not always evil.
   write: FAE are not always good.

ENDDO.

Nice you have your crystal ball at hand - without the statements I'm not able to recommend anything

bye

yk

0 Kudos

...

Edited by: Karol Seman on Nov 24, 2008 9:28 AM

former_member194613
Active Contributor
0 Kudos

@Karol,

sorry, but I find YukonKids answer fine. You asked for Joins versus View but you gave the point for FOR ALL ENTRIES versus Joins..

... so what is you actual question?

But you are right, there are joins, and other joins and even other joins, without coding there is no clear answer, therefore I am wondering why you set the question to answered already.

Siegfried

0 Kudos

Hi Siegfried,

you are right. The question was a little bit different. The problem was that I was posting question when I was not able to post the code too (posting from home). But my doubt was to fix the problem as fast as possible - that was the reason for posting without code - and also I have many select statements in the application - so I cannot post all the statements and go one by one.

The reason for rewarded points is the link that was attached to the answer. Thanks to that link I found interesting blog and took program from there, enhanced with my codings and did some tests.

The reason for closing the question is that my task was already closed - so from my point of view the question is also closed - and from information from the blog and additional articles I guess there is not possible to give general answer - just concrete answers for concrete situations.

My investigated answer for other people is following:

If you have big tables (like I have mara, makt, kssk) and you use just let's say two fields from each table, creating of dictionary view has much better performance than select using join (probably some oracle indexing for view?!?). This is very nice while you don't need to use left join instead of inner join.

I hope you understand now why I closed the task and why I gave full points to Amit. You are right that the answer from Amit is not 100% matching the question so I should probably just mark it as "very useful answer" but this answer kicked me to the right way.

If any notes don't hesitate ...

Regards,

Karol

P.S.: I agree with YK that "joins are not always evil, FAE not always good" - in this case I cannot use FAE. I just don't like the style of the answer (also with errors in the condings )...

Edited by: Karol Seman on Nov 24, 2008 10:32 AM

0 Kudos

Hi Karol,

DO 100 times.
 
   write: 'Joins are not always evil'.
   write: 'FAE are not always good'.
    
ENDDO.

It's better now?

yk

0 Kudos

>

> P.S.: I agree with YK that "joins are not always evil, FAE not always good"

You miss the point Karol. It's the other way around.

Rob

Former Member
0 Kudos

Bear in mind that views are implemented using JOINs, so there is no real performance gain either way. But you have more control and flexibility with a JOIN, so I would leave it.

Rob

Former Member
0 Kudos

This message was moderated.