DECLARE
   no_of_rows NUMBER;
   mv_size NUMBER;
BEGIN
  no_of_rows :=555;
  mv_size :=5555;
  dbms_olap.estimate_summary_size ('MV 2',
      'SELECT c.cust_id, sum(s.amount_sold) AS dollars, p.prod_id,
              sum(s.quantity_sold) as quantity
       FROM   sales s , customers c, products p
       WHERE  c.cust_id = s.cust_id
       AND    s.prod_id = p.prod_id
       AND    c.cust_state_province IN
                 (''Dublin'',''Galway'',''Hamburg'',''Istanbul'')
       GROUP BY c.cust_id, p.prod_id' , no_of_rows, mv_size );
  DBMS_OUTPUT.put_line ( 'Partial MV');
  DBMS_OUTPUT.put_line ( 'No of Rows: ' || no_of_rows );
  DBMS_OUTPUT.put_line ( 'Size of Materialized view (MB): ' ||
    round(mv_size/(1024*1024),2) );
  DBMS_OUTPUT.put_line ( '');
END;
/