Running of SQL several times

I have a general question of the works in the database. I would like to know if using a view is better than having various more specific scripts. I would like to expand on that. I would like to know if a view that represents all commands with their lines and details of the client that runs to a variety of reports and programs would be slower or faster performance than writing SQL for each report or program based on the same tables.
If you could point me in the direction of what I should read on I would also appreciate it or even the topic I should explore to answer this question. I wonder if running once and then sitting sight to 'memory' would perform no better than the execution of multiple queries. I hope that I have explained myself, otherwise I will expand on what doesn't seem wise.

Hilton Meyer wrote:
So, there is no performance gain by having already data in memory (not sure if this is the correct terminology)?
I would have thought that if the database has already run the query for the view, he wouldn't do it again or he would view anyway.

A view = SQL source.

This isn't pre-executred code that results in memory, ready to be used. In other words (for example), you create a view:

create or replace view my_view as select * from emp order by dept_id

You know how to use the notice of a customer:

select * from my_view

Data sees this as:

select * from (select * from emp order by dept_id)

A view is simply a container for the SQL source code... nothing more. It does not provide the benefits of SQL performance by caching something. (unless of course the view itself is materialized and a table used to store the results of the actual view as rows and columns).

Tags: Database

Similar Questions

Maybe you are looking for