Views , unions and performance
Posted in 1998
Topics: Performance & Tuning, SQL Development & Query Writing, Versions, Editions & End-of-Life
Hi all,
We have a view with a union of 2 indexed large tables. We want to make a join
of the view with a little table by the indexed fields, but first it makes 2
seq. scan to create the view and after it makes the join. We think this's not
the best way. We think the Optimizer is not using view info in to order to do
the query plan.
We're running over a DEC-Alpha (Unix) an IDS 7.30FC4'
-------
create view vista (c1,c2,...)as
select * from t1
union
select * from t2
--------t1 and t2 are indexed by c1 and c2
------------------
create table otra (c1,c2,...)
--------------------Select v.* from vista v, otra t where v.c1=t.c1 and v.c2=t.c2
----------------------
results:
(Temp Table for view) SEQUENTIAL SCAN
otra :SEQUENTIAL SCAN
DYNAMIC HASH JOIN
Thanks in advance
Please, mail to:
e-mail: pablof@my-dejanews.com
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own