avatar
What A DESIGN!# Java - 爪哇娇娃
s*e
1
Just find our materialized views are built on top of normal views (from
clauses are all normal views). Our normal views are chained together (again
from clauses are normal views for many of them. Only several root views are
built against tables). This is in oracle 9.2. What a "clever" design!!!!
Comments. So to speak.
avatar
L*r
2
Could you give a list of disadvantages of this design?
It is normal to use view as the abstract representation of physical table.

again
are

【在 s******e 的大作中提到】
: Just find our materialized views are built on top of normal views (from
: clauses are all normal views). Our normal views are chained together (again
: from clauses are normal views for many of them. Only several root views are
: built against tables). This is in oracle 9.2. What a "clever" design!!!!
: Comments. So to speak.

avatar
s*e
3

Stacking too many views masks performance issue.
Firstly, you might return many unneccesary columns via a complex stacked
views, but actually you only want to return several columns, which can be
done easily using a simpler query against tables.
Secondly, stack more views on top of more views may break down predicate
pushing.
thirdly, stack too many views may cause optimizer not to generate the
optimized excution plan. (subqueries may not be merged efficently)
The gain of using normal view to c

【在 L*********r 的大作中提到】
: Could you give a list of disadvantages of this design?
: It is normal to use view as the abstract representation of physical table.
:
: again
: are

avatar
i*a
4
materialized view is kind of physical table. Yes, it may take long time to
create it in your case. Materialized view is a snap shot of your data. It
contains physical data. all query will go through these physical data after
it's created. it gives you a good performance for the query.
avatar
L*r
5
If all those views share the same context and mergeable, all those
disadvantages will not happen in most cases.
How will you implement this?
It also is possible to have all those disadvantages when using normal view
with complex sql.

【在 s******e 的大作中提到】
:
: Stacking too many views masks performance issue.
: Firstly, you might return many unneccesary columns via a complex stacked
: views, but actually you only want to return several columns, which can be
: done easily using a simpler query against tables.
: Secondly, stack more views on top of more views may break down predicate
: pushing.
: thirdly, stack too many views may cause optimizer not to generate the
: optimized excution plan. (subqueries may not be merged efficently)
: The gain of using normal view to c

avatar
g*g
6
I don't like views, it's not standarized and will have performance
issue across different databases. We use hibernate and support both
MySql and Oracle in our products, we simply avoid views, it's kind of
Store procedure IMHO.

【在 L*********r 的大作中提到】
: If all those views share the same context and mergeable, all those
: disadvantages will not happen in most cases.
: How will you implement this?
: It also is possible to have all those disadvantages when using normal view
: with complex sql.

avatar
L*r
7
View and SP has different use case. To use view or SP depends on what is the
problem. It likes comparing orange to apple to compare them.
The purpose of view is not performance. It is possible to degrade the
performance if the view is not used correctly.

【在 g*****g 的大作中提到】
: I don't like views, it's not standarized and will have performance
: issue across different databases. We use hibernate and support both
: MySql and Oracle in our products, we simply avoid views, it's kind of
: Store procedure IMHO.

avatar
s*e
8

Are we still talking about "the pros and cons about stacking views on top of
each other" or you want to talk sth more general about views?
Didn't get it.
At least you do not break down predicate pushing due to stacking too many
views.
Besides complex sql doesn't necessarilly confuse db optimizer. But if you
stack views, which is just like issuing the query "select * from (selecct *
from (select * from...))... especailly the table appears more than once and
tangles with others with complext sqls

【在 L*********r 的大作中提到】
: If all those views share the same context and mergeable, all those
: disadvantages will not happen in most cases.
: How will you implement this?
: It also is possible to have all those disadvantages when using normal view
: with complex sql.

avatar
L*r
9
You know the term 'mergeable view', right?
I do not suggest stacking view. But if it does not hurt performance too much
, it is a well design, specially, in your case, the result is a materialized
view.
I just interesting in what is your implementation about your problem.
share your ideas?

of
*
and

【在 s******e 的大作中提到】
:
: Are we still talking about "the pros and cons about stacking views on top of
: each other" or you want to talk sth more general about views?
: Didn't get it.
: At least you do not break down predicate pushing due to stacking too many
: views.
: Besides complex sql doesn't necessarilly confuse db optimizer. But if you
: stack views, which is just like issuing the query "select * from (selecct *
: from (select * from...))... especailly the table appears more than once and
: tangles with others with complext sqls

avatar
s*e
10
I agree that performance gain is not goal of normal views. But in many cases
, performance is the purpose of m-view in legacy environment if a little
data stalement is not concerned(also m-view can work as wharehouse for
reporting etc). This is true in our case.
We suffer a lot for performance when we querry our normal views. This is
mainly due to the fact that they are chained together.
Since our m-views are built on top of the normal views, it is reasonable to
believe that the performance degr
avatar
L*r
11
If there is a performance problem, this stack view design is bad in your
case.
Your performance issue often happens when working with large data table or
fact table. This kind of performance tuning always is interesting.
Hope you get it done and share your experience later.

cases
to

【在 s******e 的大作中提到】
: I agree that performance gain is not goal of normal views. But in many cases
: , performance is the purpose of m-view in legacy environment if a little
: data stalement is not concerned(also m-view can work as wharehouse for
: reporting etc). This is true in our case.
: We suffer a lot for performance when we querry our normal views. This is
: mainly due to the fact that they are chained together.
: Since our m-views are built on top of the normal views, it is reasonable to
: believe that the performance degr

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。