matthias
matthias

Reputation: 2062

Performance of Oracle Database Link

I have two databases A and B. My application runs on Database A. Now I must retrieve some data from database B. Therefore I created a database link to B.

I am wondering what is faster:

  1. Create a View with the corresponding select on database B and get the data via this view: select * from myview@B
  2. Select tables directly: select * from table1@B, table2@B left outer join table3@B...

Upvotes: 0

Views: 1724

Answers (2)

atokpas
atokpas

Reputation: 3351

About Views

A view is a logical representation of another table or combination of tables. A view derives its data from the tables on which it is based. These tables are called base tables. Base tables might in turn be actual tables or might be views themselves. All operations performed on a view actually affect the base table of the view.

You don't get any performance benefits of using view instead of tables. These are simply a stored query, When you submit select * from myview@B, this simply retrieve the view definition from data dictionary and rewrite the query using it.

Upvotes: 1

Dong
Dong

Reputation: 328

I think probably they would be just as fast since the execution plan will be identical. But would be easier on you to just do second option.

Upvotes: 1

Related Questions