Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Query performace against View or Table.

Re: Query performace against View or Table.

From: NetComrade <andreyNSPAM_at_bookexchange.net>
Date: Wed, 07 Nov 2001 16:06:06 GMT
Message-ID: <3be95b37.670335691@news.globix.com>


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 email
Received on Wed Nov 07 2001 - 10:06:06 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US