optimize: view of views

optimize: view of views

Post by Jochen Gref » Fri, 11 May 2001 18:35:28



I have packed the core calculation of a sum in an view.
To make different views i make the SELECT
on the first view instead of packing all together in one.
This helps me to change the core calculation (and they forced me to change a
lot in the past)
without reprogramming the second view.
I have not only two views, the second view is
used in a third and so on this enables me to change the hirachical ordering
(same reason). So I have alot of views of views and the query time
is about 10s. I think the reason is that each view is calculated over all
the
available data and the joins are calculated later.
The question is: Do i have to program all views from scratch without using
SELECT on views?
Is there a posibility to let a program optimize this for me (wich)?

Excuse my english
Thanks

 
 
 

optimize: view of views

Post by Hirantha S Hettiarachch » Fri, 11 May 2001 20:54:58


Jochen,
if you are using sql 2000 theres a cool feature that you can index a view.
may be that will speed up.
but there are limitations on that too.. you might want to read up on BOL
about indexing views

--
~~~~~~~~~~~~~~~~~~~~~~~~~~
Hirantha S Hettiarachchi
Please reply only to the newsgroups.
When posting, inclusion of SQL (CREATE TABLE ..., INSERT ..., etc.) which
can be cut and pasted into Query Analyzer is appreciated.

Quote:> I have packed the core calculation of a sum in an view.
> To make different views i make the SELECT
> on the first view instead of packing all together in one.
> This helps me to change the core calculation (and they forced me to change
a
> lot in the past)
> without reprogramming the second view.
> I have not only two views, the second view is
> used in a third and so on this enables me to change the hirachical
ordering
> (same reason). So I have alot of views of views and the query time
> is about 10s. I think the reason is that each view is calculated over all
> the
> available data and the joins are calculated later.
> The question is: Do i have to program all views from scratch without using
> SELECT on views?
> Is there a posibility to let a program optimize this for me (wich)?

> Excuse my english
> Thanks


 
 
 

optimize: view of views

Post by Prabhaker Pothara » Fri, 25 May 2001 23:06:08


Jochen,

I believe you are trying to calcualte sum of sums thru views, basically you
are trying to optimize the query to perform better, you may want to try the
SQL 2K features like index views and User-Defined Functions to improve the
performance. Please refer to BOL for Index views and UDFs.

Thanks
Prabhaker

 
 
 

1. ASA6: Optimize view of a view?????

Anyone know how to get the ASA6 optimizer to use indexes on a view of a view?  
If I run the outer view's select statement from ISQL it comes back in a couple
of seconds.  If I select from the outer view, I havent seen it finish yet.

TIA,

klint.

--
+---------------------------------------+-----------------+
: Klint Gore                            : "Non rhyming    :

: Snail   : A.B.R.I.                    :  possibilities  :
: Mail      University of New England   :  are useless"   :
:           Armidale NSW 2351 Australia :     L.J.J.      :
: Fax     : +61 2 6772 5376             :                 :
+---------------------------------------+-----------------+

2. MAX_ROWS_PROCESSED (or sth similar)

3. How are views on views on views executed ??

4. Help with SQL string

5. optimizing a view

6. Dataease 4.53 - DATAEASE EXPIRED !!

7. Optimize SQL statement having View

8. 2nd RFD: comp.lang.java.(server-side,comp.lang.java.servlet}

9. optimize View on Tables on different databases

10. Snapshot for optimizing views

11. Optimizing UNION ALL (partition) views in 7.3

12. view optimize???

13. Optimizing Queries, Views vs Tables - Info Needed