Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: slow performance in query a view
Look at explain plans for the two queries:
select emp_no from v_emp group by emp_no
and
select emp_no from test group by emp_no;
to see if there is any difference.
HTH. Guang
"Chong Pok" <chongpok18_at_hotmail.com> wrote in message news:<3f698bf0$1_at_shknews01>...
> I have created a view and try to execute a select + group by query of the
> view. However, the performance is very slow.
> select emp_no from v_emp group by emp_no
>
> However, if I create a temp. table first and create an index. The
> performance is far more better.
> create table test as select emp_no from v_emp;
> create index ix_test on test(emp_no);
> select emp_no from test group by emp_no;
> The total time is much shorter
>
> I wonder whether Oracle can take advantage of the underlying table index of
> the view? What's the proper implementation in query such kind of view?
>
> Many thanks
Received on Fri Sep 19 2003 - 22:07:11 CDT