SQL> set autotrace on statistics SQL> set timing on SQL> SELECT o.owner, o.object_type, COUNT(*) 2 FROM all_my_objects o 3 GROUP BY o.object_type, o.owner 4 UNION ALL 5 SELECT NULL, o.object_type, COUNT(*) 6 FROM all_my_objects o 7 GROUP BY o.object_type 8 UNION ALL 9 SELECT o.owner, NULL, COUNT(*) 10 FROM all_my_objects o 11 GROUP BY o.owner 12 UNION ALL 13 SELECT NULL, NULL, COUNT(*) 14 FROM all_my_objects o; OWNER OBJECT_TYPE COUNT(*) ------------------------------ ------------------- ---------- 327 rows selected. Elapsed: 00:00:58.26 Statistics ---------------------------------------------------------- 0 recursive calls 0 db block gets 44008 consistent gets 24100 physical reads 0 redo size 9652 bytes sent via SQL*Net to client 651 bytes received via SQL*Net from client 23 SQL*Net roundtrips to/from client 0 sorts (memory) 0 sorts (disk) 327 rows processed