Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Replacing GROUP BY with Sub-queries

Re: Replacing GROUP BY with Sub-queries

From: Noons <wizofoz2k_at_yahoo.com.au>
Date: 29 Oct 2003 22:40:45 -0800
Message-ID: <73e20c6c.0310292240.69f66bac@posting.google.com>


Daniel Morgan <damorgan_at_x.washington.edu> wrote in message news:<1067473473.804043_at_yasure>...

> Thanks to both of you. I copied the sample too closely.

And if you really want the correct results as well as a jump in performance of nearly an order of magnitude, try this:

select
b.table_name,
(select count(1) from all_indexes a where a.table_name = b.table_name  and a.table_owner = b.owner) num_indexes from all_tables b

<never assume object names are unique across "all*" views!> ;)
Cheers
Nuno Souto
wizofoz2k_at_yahoo.com.au.nospam Received on Thu Oct 30 2003 - 00:40:45 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US