TRUNCATE TABLE plan_table;

EXPLAIN PLAN FOR
   SELECT /*+ rewrite (costs_pm_mv) */ p.prod_name, sum(unit_cost)
   FROM   costs c, products p
   WHERE  c.prod_id = p.prod_id
   AND    c.time_id >= TO_DATE('01-JAN-2000','DD-MON-YYYY')
   AND    c.time_id < TO_DATE('01-JAN-2002','DD-MON-YYYY')
   GROUP BY prod_name;

set linesize 132
set pagesize 999
SELECT * FROM TABLE(dbms_xplan.display);