Subject Re: Select or View
Author Adam
--- In firebird-support@yahoogroups.com, "tomkrej" <respektive@...> wrote:
>
> Hi, Is there some performance difference between
>
> select * from view_something;
>
> and
>
> select * from table_one, table_two where table_one.id = table_two.id;
>
> when view is defined absolutely same as that select ???

For such a simple query there is no performance difference. You can
see this by comparing the plans of each query. It is not a good idea
to benchmark them one after the other because the second one gets the
advantage of any garbage collection having been done, as well as a
higher chance of getting cache hits.

>
> Or the advantage of view is mainly in better readability of code and
> security options ??

It also provides backwards compatibility and simplicity for third
party interfaces. By abstracting the third party interfaces from the
tables themselves (even creating updateable views), you retain the
flexibility of refactoring your table structures to allow improved
functionality without breaking anything.

Adam