In general, is direct query faster than a view?
Just a general question. I'm wondering if it's CRAZY to build view that groups data when I can just do my own count:
So, for example, a simple count. (There's an index on id):
SELECT count(1) from largeTable where id=100
Is there huge overhead to create a view as:
CREATE VIEW myView AS
SELECT a.id as id, count(b.id) as num
from smallTable a left join largeTable b on (a.id=b.id)
group by a.id
and then pulling data from the view:
SELECT num from myView where id = 100
As long as I don't call the view without a where clause, are they equivalent?
Subject
Views
Written By
Posted
In general, is direct query faster than a view?
3328
July 15, 2012 02:52PM
1357
July 15, 2012 03:48PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.