Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Query performace against View or Table.
really depends on the SQL of the view... (if the view uses a good
index, then it's probably faster).
do an explain plan of the sql under the view, or set autotrace on (in sqlplus) and do select * from the view (both require PLAN_TABLE).
The way I would do it is
create materialized view report_sales_by_date
build immediate refresh on commit
as
select sum(money_made), trunc(when_bought)
group by trunc(when_bought)
and then select from that
On 7 Nov 2001 06:10:58 -0800, j_g_ahn_at_hotmail.com (Jong Ahn) wrote:
>Hi
>
>I'm looking for better way to query data.
>
>There are 2 million rows in 'Shipping' table and 'Today_shipping' view
>has only 2500 records. 'Today_shipping' is a view which select only
>today's shipments based on 'Shipping' table.
>Which is better doing query against View or Table?
>
>Thank you very much for your help.
>
>Jong
.......
We use Oracle 8.1.6-8.1.7 on Solaris 2.6, 2.7 boxes
Andrey Dmitriev eFax: (978) 383-5892 Daytime: (917) 750-3630 AOL: NetComrade ICQ: 11340726 remove NSPAM to emailReceived on Wed Nov 07 2001 - 10:06:06 CST