• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

effiiciency comparison while fetching rows from a tables or view build on top of them

 
Pratibha Malhotra
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
What is more effiecient to fetch data
--> a join of lets say 5 tables.
--> a view build on top of these 5 tables.
as per my info view is nothing but a created stored in DB and this query inturn fetch data from the tables only.
kindly clarify...
 
Avi Abrami
Ranch Hand
Posts: 1141
1
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gunjan,
In general, querying a view is slower than querying directly from the table(s). But in order to really know which is faster, I think you would need to record the time it takes in both cases.
Good Luck,
Avi.
 
Rudy Dakota
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Avi, Gunjan,
A view is nothing but a select statement stored within the database. Views and queries should therefore not differ in the execution plan or the performance. One exception that comes to mind: views might be slightly more sensitive to sub-optimal formulation of search conditions, as the underlying query is abstracted from and thus likeley not known at all times. But that doesn't do away with the general rule: same execution plan, same performance.
Good riding,
Rudy.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic