Application Development and Automation 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: 
Read only

Views vs Joins

Former Member
0 Likes
1,147

Hi

Can you please tell me why Views are faster than Database Joins?

Thanks

Hi

Can you please tell me why Views are faster than Database Joins?

Thanks

6 REPLIES 6
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
969

Moved to ABAP Dictionary Forum.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
969

Your statement is a generalization and is not always true.

But note this:

Views might be cached by application servers, joins are always accessed by database directly.

Read only

0 Likes
969

Then why do we prefer to create views and not Joins..

I think there has to be some reason for the views to be faster than using SELECT by JOINS..

Thanks

Read only

0 Likes
969

If you are going to use a specific join and this will be used by your entire team, I would rather create a view and use the view rather than using the join every time, it becomes a reusable component, right?

As fast as speed is concerned, I don't think it can be generalized.

Regards,

Ravi

Read only

0 Likes
969

Subhash,

"Then why do we prefer to create views and not Joins"

Who prefers to create views over joins? Your company?

You and your company may have development standards that they want you to follow; however, on an overall stance, you need to create whatever "fits your need."

VIEWS behave like reuseable data objects. Other developers no longer need to know the details of numerous tables to combine data between them.

JOINS are standalone SQL statements. They have no formal reuseability.

Knowing these facts (and if your company DOES NOT have developments in this area), make your own choice as a case-by-case basis.

Don't forget to reward points for menaingful answers. Thanks.

Read only

0 Likes
969

Also -

"I think there has to be some reason for the views to be faster than using SELECT by JOINS.."

As stated above-Views might be cached by application servers, joins are always accessed by database directly.

IF the VIEW's results are cached/stored on the app server, then the next request for this same info will certainly be faster.

Has your question been answered?

Please don't forget those points... or clarify your question further. Thanks in advance.