开发者

Tablespaces used to create a materialized view?

I'm trying to create a view as such:

CREATE MATERIALIZED ReasonableSizedView
TABLESPACE MyMediumTS
AS 
select COUNT(something) AS allsomethings,
    thetype AS thing,
    status
from SomeMassiveTable
where
    thetype = 'x'
    AND status IN (0,1,2,3)
GROUP BY
    thetype,
    status;

And all I get is an error: ORA-01658: unable to create INITIAL extent for segment in tablespace MySmallTS

Okay, now, MySmallTS is the default ts for the user I'm trying to create the view - and it is full. The thing of a full table space, is a problem apart, and is being dealt with, but why on earth is Oracle trying to use it for this view even though I'm explicitly telling where I want it?

Further more, if I change the query a and remove the group by's, it will work, and it will create the view in the correct table space.

I wonder, the whole operation of grouping and summing and stuff, shouldn't that be using the TEMP table space assigned for that user? T开发者_运维技巧hat would seem reasonable, and by the way, my temp has plenty of space...

why is that so?

thanks


Based on the fact that it works when removing the GROUP BY, my guess is that MySmallTS is also assigned as the default temporary tablespace for that user.

Building the intermediate result will be done in the temporary tablespace and when using the GROUP BY this gets too big for MySmallTS

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜