Return-Path: <root@fatcity.cts.com>
Received: from newsfeed.cts.com (newsfeed.cts.com [209.68.248.164])
 by naude.co.za (8.11.2/8.11.2) with SMTP id g78FVeK24449
 for <oracle-l@naude.co.za>; Thu, 8 Aug 2002 11:31:40 -0400
Received: from fatcity.UUCP (uucp@localhost)
 by newsfeed.cts.com (8.9.3/8.9.3) with UUCP id IAA14265;
 Thu, 8 Aug 2002 08:31:36 -0700 (PDT)
Received: by fatcity.com (26-Feb-2001/v1.0g-b71/bab) via UUCP id 004AF0FB; Thu, 08 Aug 2002 07:53:27 -0800
Message-ID: <F001.004AF0FB.20020808075327@fatcity.com>
Date: Thu, 08 Aug 2002 07:53:27 -0800
To: Multiple recipients of list ORACLE-L <ORACLE-L@fatcity.com>
X-Comment: Oracle RDBMS Community Forum
X-Sender: Paula_Stankus@doh.state.fl.us
Sender: root@fatcity.com
Reply-To: ORACLE-L@fatcity.com
Errors-To: ML-ERRORS@fatcity.com
From: Paula_Stankus@doh.state.fl.us
Subject: RE: SOME SOLUTIONS!
Organization: Fat City Network Services, San Diego, California
X-ListServer: v1.0g, build 71; ListGuru (c) 1996-2001 Bruce A. Bergman
Precedence: bulk
Mime-Version: 1.0
Content-Type: multipart/alternative;	boundary="----_=_NextPart_001_01C23EEA.F48484B0"
------_=_NextPart_001_01C23EEA.F48484B0
Content-Type: text/plain

Guys,

Any ideas why sum - with same exec. plan and not going to disk is 5 sec.
response versus subsecond and anyway to get around this w/o building a
preaggregated data set since there are so many permutations possible????
Will I have to redesign to use STAR SCHEMA and will that really help!!!

-----Original Message-----
Sent: Thursday, August 08, 2002 10:40 AM
To: 'ORACLE-L@fatcity.com'


Okay, 

Just going from #1 query to #2 query went from subsecond response to 6 secs.
Not to mention for each sum it gets progressively worse!!!.  The explain
plan is exactly the same and I ran the sort query below and no rows
returned.
rem truncate table plan_table;
set timing on;
rem explain plan set statement_id='RON' for
select
/*+ INDEX(mv_birthstat,ndx_mvyr) */
 brth_mthr_res_newco_code  County,count(*),
-- sum(cert_chld_brth_year) Num1
 --sum(decode(greatest(cert_chld_brth_year,1996),
least(cert_chld_brth_year,1998
), 1, 0)) / 3 Num2,
 --sum(decode(greatest(cert_chld_brth_year,1997),
least(cert_chld_brth_year,1999
), 1, 0)) / 3 Num3
from mv_birthstat
where cert_chld_brth_year between '1995' and '1999'
and brth_mthr_res_state_code='10'
and brth_mthr_age between 15 and 41
group by brth_mthr_res_newco_code;

/*+ INDEX(mv_birthstat,ndx_mvyr) */
 brth_mthr_res_newco_code  County,
 sum(cert_chld_brth_year) Num1
 --sum(decode(greatest(cert_chld_brth_year,1996),
least(cert_chld_brth_year,1998
), 1, 0)) / 3 Num2,
 --sum(decode(greatest(cert_chld_brth_year,1997),
least(cert_chld_brth_year,1999
), 1, 0)) / 3 Num3
from mv_birthstat
where cert_chld_brth_year between '1995' and '1999'
and brth_mthr_res_state_code='10'
and brth_mthr_age between 15 and 41
group by brth_mthr_res_newco_code;



WHY WHY WHY WHY!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-----Original Message-----
Sent: Wednesday, August 07, 2002 11:37 PM
To: Multiple recipients of list ORACLE-L


Paula,

Sorry to join this thread late, if I am rehashing just
igonre.

I notice that your 'numbers' are surrounded by quotes,
which will implicitly disable the index on those
columns, perhaps the cause of the index hint. Are
those columns text or numbers? If numbers, take out
the quotes (and perhaps the hint) and rerun query.

Also, your aggregate functions will cause sorting -
are you sorting to disk? See the query at the end of
this to find out. If so, perhaps a larger
sort_area_size and sort_area_retained_size might be in
order.

Again, ignore if redundant.

Run this to look at sorting:

select t1.tablespace 
, extents
, sum( t1.blocks * to_number( t3.value ) ) / 1024 /
1024 mb_used 
, sum( t1.extents ) tot_extents 
, t2.username 
, t2.osuser 
, t2.SID ||','|| t2.serial# SID_PID 
, t4.spid 
, t5.sql_text
, t1.segtype
from 
v$sort_usage t1 
,v$session t2 
,v$parameter t3 
,v$process t4 
,v$sqlarea t5
where t1.SESSION_ADDR = t2.SADDR 
and t3.name = 'db_block_size' 
and (t2.PROCESS=t4.SPID or t2.paddr = t4.addr) 
and t2.sql_address=t5.address
and t2.status = 'ACTIVE'
group by 
t1.tablespace 
, t2.username 
, t2.osuser 
, t2.machine 
, t2.schemaname 
, t2.program 
, t2.SID ||','|| t2.serial# 
, t4.spid
, t5.sql_text
, t1.segtype
, segfile#
, extents
/


hth, 

Jack

--- Paula_Stankus@doh.state.fl.us wrote:
> Guys,
> 
> By changing objects to noparallel, creating
> bitmapped index containing all
> columns that was local and prefixed.  Moving to
> 8.1.7.4 I was able to
> improve performance from minutes to many seconds to
> seconds for the
> following (not using 'in' or 'or' in predicate
> helped too):
> select
> /*+ INDEX(mv_birthstat,ndx_mvyr) */
>  brth_mthr_res_newco_code  County,count(*)
> from mv_birthstat
> where cert_chld_brth_year between '1995' and '1999'
> and brth_mthr_res_state_code='10'
> and brth_mthr_age between 15 and 41
> group by brth_mthr_res_newco_code;
> 
> Then adding the following the query takes 15 seconds
> again - any ideas for
> speeding it up?  Please don't say hire a new DBA.  I
> have really been
> working on this hard with only annoying input from
> Oracle's technical
> support and a lot of good reference manuals
> (Jonathon Lewis, 101 Perf.
> Tuning, Oracle SQL - Guy Harrison) for my
> companions.  Great I know but
> lonely.  
> 
> select
> /*+ INDEX(mv_birthstat,ndx_mvyr) */
>  brth_mthr_res_newco_code  County
>  sum(decode(greatest(cert_chld_birth_year,1995),
> least(cert_chld_birth_year,1997), 1, 0)) / 3 Num1,
>  sum(decode(greatest(cert_chld_birth_year,1996),
> least(cert_chld_birth_year,1998), 1, 0)) / 3 Num2,
>  sum(decode(greatest(cert_chld_birth_year,1997),
> least(cert_chld_birth_year,1999), 1, 0)) / 3 Num3
> from mv_birthstat
> where cert_chld_brth_year between '1995' and '1999'
> and brth_mthr_res_state_code='10'
> and brth_mthr_age between 15 and 41
> group by brth_mthr_res_newco_code;
> 
> I am going to try the sums in a outer query.  
> 
> 
> 
> -----Original Message-----
> Sent: Wednesday, August 07, 2002 4:45 PM
> To: Stankus, Paula G; 'ORACLE-L@fatcity.com'
> 
> 
> Mother's state 80% are in Florida.  However, this is
> a 'local' prefixed
> bitmap index.  I would expect to use year to
> eliminate partion. then w/in
> year by state - second col. in query.
> 
> -----Original Message-----
> Sent: Wednesday, August 07, 2002 4:35 PM
> To: Stankus, Paula G; 'ORACLE-L@fatcity.com'
> 
> 
> BTW,
> 
> SQL> select blocks from dba_tables
>   2  where table_name = 'MV_BIRTHSTAT';
> 
>     BLOCKS
> ----------
>     236542
> 
> SQL> select clustering_factor from user_indexes
>   2  where table_name='MV_BIRTHSTAT';
> 
> CLUSTERING_FACTOR
> -----------------
>              1657
>               170
> 
> -----Original Message-----
> Sent: Wednesday, August 07, 2002 4:28 PM
> To: Stankus, Paula G; 'ORACLE-L@fatcity.com'
> 
> 
> Help - weird performance problem!!!
> 
>
----------------------------------------------------------------------------
> ----
> | Operation                 |  Name    |  Rows |
> Bytes|  Cost  | Pstart|
> Pstop |
>
----------------------------------------------------------------------------
> ----
> | SELECT STATEMENT          |          |     1 |   
> 5 |   9331 |       |
> |
> |  SORT AGGREGATE           |          |     1 |   
> 5 |        |       |
> |
> |   SORT AGGREGATE          |          |     1 |   
> 5 |        |       |
> |
> |    INLIST ITERATOR        |          |       |    
>  |        |       |
> |
> |     PARTITION RANGE ITERAT|          |       |    
>  |        |KEY(I)
> |KEY(I) |
> |      BITMAP CONVERSION COU|          |       |    
>  |        |       |
> |
> |       BITMAP INDEX RANGE S|NDX_MVYRS |       |    
>  |        |KEY(I)
> |KEY(I) |
> 
> Cost higher but less than a second.
> 
> Ignore the cost - higher cost was sign.
> Faster!!!!!Does Key(*) mean it is
> doing part. Elimin.  I think so but can you see the
> inlist?
> 
> Very fast with all years involved.  Then added
> predicate:
> 
> select
> /*+ INDEX(mv_birthstat,ndx_mvyrstatecoage) */
> count(*) from mv_birthstat
> where cert_chld_brth_year
> in('1995','1996','1997','1998','1999')
>    and brth_MTHR_res_STATE_CODE = '10';
> 
> - snails crawl by just adding the additional
> column!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
> 


__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Jack Silvey
  INET: jack_silvey@yahoo.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru@fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

------_=_NextPart_001_01C23EEA.F48484B0
Content-Type: text/html
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3DUS-ASCII">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2654.45">
<TITLE>RE: SOME SOLUTIONS!</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=3D2>Guys,</FONT>
</P>

<P><FONT SIZE=3D2>Any ideas why sum - with same exec. plan and not =
going to disk is 5 sec. response versus subsecond and anyway to get =
around this w/o building a preaggregated data set since there are so =
many permutations possible????&nbsp; Will I have to redesign to use =
STAR SCHEMA and will that really help!!!</FONT></P>

<P><FONT SIZE=3D2>-----Original Message-----</FONT>
<BR><FONT SIZE=3D2>From: Stankus, Paula G </FONT>
<BR><FONT SIZE=3D2>Sent: Thursday, August 08, 2002 10:40 AM</FONT>
<BR><FONT SIZE=3D2>To: 'ORACLE-L@fatcity.com'</FONT>
<BR><FONT SIZE=3D2>Subject: RE: SOME SOLUTIONS!</FONT>
</P>
<BR>

<P><FONT SIZE=3D2>Okay, </FONT>
</P>

<P><FONT SIZE=3D2>Just going from #1 query to #2 query went from =
subsecond response to 6 secs.&nbsp; Not to mention for each sum it gets =
progressively worse!!!.&nbsp; The explain plan is exactly the same and =
I ran the sort query below and no rows returned.</FONT></P>

<P><FONT SIZE=3D2>rem truncate table plan_table;</FONT>
<BR><FONT SIZE=3D2>set timing on;</FONT>
<BR><FONT SIZE=3D2>rem explain plan set statement_id=3D'RON' for</FONT>
<BR><FONT SIZE=3D2>select</FONT>
<BR><FONT SIZE=3D2>/*+ INDEX(mv_birthstat,ndx_mvyr) */</FONT>
<BR><FONT SIZE=3D2>&nbsp;brth_mthr_res_newco_code&nbsp; =
County,count(*),</FONT>
<BR><FONT SIZE=3D2>-- sum(cert_chld_brth_year) Num1</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;--sum(decode(greatest(cert_chld_brth_year,1996), =
least(cert_chld_brth_year,1998</FONT>
<BR><FONT SIZE=3D2>), 1, 0)) / 3 Num2,</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;--sum(decode(greatest(cert_chld_brth_year,1997), =
least(cert_chld_brth_year,1999</FONT>
<BR><FONT SIZE=3D2>), 1, 0)) / 3 Num3</FONT>
<BR><FONT SIZE=3D2>from mv_birthstat</FONT>
<BR><FONT SIZE=3D2>where cert_chld_brth_year between '1995' and =
'1999'</FONT>
<BR><FONT SIZE=3D2>and brth_mthr_res_state_code=3D'10'</FONT>
<BR><FONT SIZE=3D2>and brth_mthr_age between 15 and 41</FONT>
<BR><FONT SIZE=3D2>group by brth_mthr_res_newco_code;</FONT>
</P>

<P><FONT SIZE=3D2>/*+ INDEX(mv_birthstat,ndx_mvyr) */</FONT>
<BR><FONT SIZE=3D2>&nbsp;brth_mthr_res_newco_code&nbsp; County,</FONT>
<BR><FONT SIZE=3D2>&nbsp;sum(cert_chld_brth_year) Num1</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;--sum(decode(greatest(cert_chld_brth_year,1996), =
least(cert_chld_brth_year,1998</FONT>
<BR><FONT SIZE=3D2>), 1, 0)) / 3 Num2,</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;--sum(decode(greatest(cert_chld_brth_year,1997), =
least(cert_chld_brth_year,1999</FONT>
<BR><FONT SIZE=3D2>), 1, 0)) / 3 Num3</FONT>
<BR><FONT SIZE=3D2>from mv_birthstat</FONT>
<BR><FONT SIZE=3D2>where cert_chld_brth_year between '1995' and =
'1999'</FONT>
<BR><FONT SIZE=3D2>and brth_mthr_res_state_code=3D'10'</FONT>
<BR><FONT SIZE=3D2>and brth_mthr_age between 15 and 41</FONT>
<BR><FONT SIZE=3D2>group by brth_mthr_res_newco_code;</FONT>
</P>
<BR>
<BR>

<P><FONT SIZE=3D2>WHY WHY WHY =
WHY!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!</FONT>
<BR><FONT SIZE=3D2>-----Original Message-----</FONT>
<BR><FONT SIZE=3D2>From: Jack Silvey [<A =
HREF=3D"mailto:jack_silvey@yahoo.com">mailto:jack_silvey@yahoo.com</A>]<=
/FONT>
<BR><FONT SIZE=3D2>Sent: Wednesday, August 07, 2002 11:37 PM</FONT>
<BR><FONT SIZE=3D2>To: Multiple recipients of list ORACLE-L</FONT>
<BR><FONT SIZE=3D2>Subject: RE: SOME SOLUTIONS!</FONT>
</P>
<BR>

<P><FONT SIZE=3D2>Paula,</FONT>
</P>

<P><FONT SIZE=3D2>Sorry to join this thread late, if I am rehashing =
just</FONT>
<BR><FONT SIZE=3D2>igonre.</FONT>
</P>

<P><FONT SIZE=3D2>I notice that your 'numbers' are surrounded by =
quotes,</FONT>
<BR><FONT SIZE=3D2>which will implicitly disable the index on =
those</FONT>
<BR><FONT SIZE=3D2>columns, perhaps the cause of the index hint. Are</FO=
NT>
<BR><FONT SIZE=3D2>those columns text or numbers? If numbers, take =
out</FONT>
<BR><FONT SIZE=3D2>the quotes (and perhaps the hint) and rerun =
query.</FONT>
</P>

<P><FONT SIZE=3D2>Also, your aggregate functions will cause sorting =
-</FONT>
<BR><FONT SIZE=3D2>are you sorting to disk? See the query at the end =
of</FONT>
<BR><FONT SIZE=3D2>this to find out. If so, perhaps a larger</FONT>
<BR><FONT SIZE=3D2>sort_area_size and sort_area_retained_size might be =
in</FONT>
<BR><FONT SIZE=3D2>order.</FONT>
</P>

<P><FONT SIZE=3D2>Again, ignore if redundant.</FONT>
</P>

<P><FONT SIZE=3D2>Run this to look at sorting:</FONT>
</P>

<P><FONT SIZE=3D2>select t1.tablespace </FONT>
<BR><FONT SIZE=3D2>, extents</FONT>
<BR><FONT SIZE=3D2>, sum( t1.blocks * to_number( t3.value ) ) / 1024 =
/</FONT>
<BR><FONT SIZE=3D2>1024 mb_used </FONT>
<BR><FONT SIZE=3D2>, sum( t1.extents ) tot_extents </FONT>
<BR><FONT SIZE=3D2>, t2.username </FONT>
<BR><FONT SIZE=3D2>, t2.osuser </FONT>
<BR><FONT SIZE=3D2>, t2.SID ||','|| t2.serial# SID_PID </FONT>
<BR><FONT SIZE=3D2>, t4.spid </FONT>
<BR><FONT SIZE=3D2>, t5.sql_text</FONT>
<BR><FONT SIZE=3D2>, t1.segtype</FONT>
<BR><FONT SIZE=3D2>from </FONT>
<BR><FONT SIZE=3D2>v$sort_usage t1 </FONT>
<BR><FONT SIZE=3D2>,v$session t2 </FONT>
<BR><FONT SIZE=3D2>,v$parameter t3 </FONT>
<BR><FONT SIZE=3D2>,v$process t4 </FONT>
<BR><FONT SIZE=3D2>,v$sqlarea t5</FONT>
<BR><FONT SIZE=3D2>where t1.SESSION_ADDR =3D t2.SADDR </FONT>
<BR><FONT SIZE=3D2>and t3.name =3D 'db_block_size' </FONT>
<BR><FONT SIZE=3D2>and (t2.PROCESS=3Dt4.SPID or t2.paddr =3D t4.addr) =
</FONT>
<BR><FONT SIZE=3D2>and t2.sql_address=3Dt5.address</FONT>
<BR><FONT SIZE=3D2>and t2.status =3D 'ACTIVE'</FONT>
<BR><FONT SIZE=3D2>group by </FONT>
<BR><FONT SIZE=3D2>t1.tablespace </FONT>
<BR><FONT SIZE=3D2>, t2.username </FONT>
<BR><FONT SIZE=3D2>, t2.osuser </FONT>
<BR><FONT SIZE=3D2>, t2.machine </FONT>
<BR><FONT SIZE=3D2>, t2.schemaname </FONT>
<BR><FONT SIZE=3D2>, t2.program </FONT>
<BR><FONT SIZE=3D2>, t2.SID ||','|| t2.serial# </FONT>
<BR><FONT SIZE=3D2>, t4.spid</FONT>
<BR><FONT SIZE=3D2>, t5.sql_text</FONT>
<BR><FONT SIZE=3D2>, t1.segtype</FONT>
<BR><FONT SIZE=3D2>, segfile#</FONT>
<BR><FONT SIZE=3D2>, extents</FONT>
<BR><FONT SIZE=3D2>/</FONT>
</P>
<BR>

<P><FONT SIZE=3D2>hth, </FONT>
</P>

<P><FONT SIZE=3D2>Jack</FONT>
</P>

<P><FONT SIZE=3D2>--- Paula_Stankus@doh.state.fl.us wrote:</FONT>
<BR><FONT SIZE=3D2>&gt; Guys,</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; By changing objects to noparallel, =
creating</FONT>
<BR><FONT SIZE=3D2>&gt; bitmapped index containing all</FONT>
<BR><FONT SIZE=3D2>&gt; columns that was local and prefixed.&nbsp; =
Moving to</FONT>
<BR><FONT SIZE=3D2>&gt; 8.1.7.4 I was able to</FONT>
<BR><FONT SIZE=3D2>&gt; improve performance from minutes to many =
seconds to</FONT>
<BR><FONT SIZE=3D2>&gt; seconds for the</FONT>
<BR><FONT SIZE=3D2>&gt; following (not using 'in' or 'or' in =
predicate</FONT>
<BR><FONT SIZE=3D2>&gt; helped too):</FONT>
<BR><FONT SIZE=3D2>&gt; select</FONT>
<BR><FONT SIZE=3D2>&gt; /*+ INDEX(mv_birthstat,ndx_mvyr) */</FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp; brth_mthr_res_newco_code&nbsp; =
County,count(*)</FONT>
<BR><FONT SIZE=3D2>&gt; from mv_birthstat</FONT>
<BR><FONT SIZE=3D2>&gt; where cert_chld_brth_year between '1995' and =
'1999'</FONT>
<BR><FONT SIZE=3D2>&gt; and brth_mthr_res_state_code=3D'10'</FONT>
<BR><FONT SIZE=3D2>&gt; and brth_mthr_age between 15 and 41</FONT>
<BR><FONT SIZE=3D2>&gt; group by brth_mthr_res_newco_code;</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; Then adding the following the query takes 15 =
seconds</FONT>
<BR><FONT SIZE=3D2>&gt; again - any ideas for</FONT>
<BR><FONT SIZE=3D2>&gt; speeding it up?&nbsp; Please don't say hire a =
new DBA.&nbsp; I</FONT>
<BR><FONT SIZE=3D2>&gt; have really been</FONT>
<BR><FONT SIZE=3D2>&gt; working on this hard with only annoying input =
from</FONT>
<BR><FONT SIZE=3D2>&gt; Oracle's technical</FONT>
<BR><FONT SIZE=3D2>&gt; support and a lot of good reference =
manuals</FONT>
<BR><FONT SIZE=3D2>&gt; (Jonathon Lewis, 101 Perf.</FONT>
<BR><FONT SIZE=3D2>&gt; Tuning, Oracle SQL - Guy Harrison) for =
my</FONT>
<BR><FONT SIZE=3D2>&gt; companions.&nbsp; Great I know but</FONT>
<BR><FONT SIZE=3D2>&gt; lonely.&nbsp; </FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; select</FONT>
<BR><FONT SIZE=3D2>&gt; /*+ INDEX(mv_birthstat,ndx_mvyr) */</FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp; brth_mthr_res_newco_code&nbsp; =
County</FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp; =
sum(decode(greatest(cert_chld_birth_year,1995),</FONT>
<BR><FONT SIZE=3D2>&gt; least(cert_chld_birth_year,1997), 1, 0)) / 3 =
Num1,</FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp; =
sum(decode(greatest(cert_chld_birth_year,1996),</FONT>
<BR><FONT SIZE=3D2>&gt; least(cert_chld_birth_year,1998), 1, 0)) / 3 =
Num2,</FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp; =
sum(decode(greatest(cert_chld_birth_year,1997),</FONT>
<BR><FONT SIZE=3D2>&gt; least(cert_chld_birth_year,1999), 1, 0)) / 3 =
Num3</FONT>
<BR><FONT SIZE=3D2>&gt; from mv_birthstat</FONT>
<BR><FONT SIZE=3D2>&gt; where cert_chld_brth_year between '1995' and =
'1999'</FONT>
<BR><FONT SIZE=3D2>&gt; and brth_mthr_res_state_code=3D'10'</FONT>
<BR><FONT SIZE=3D2>&gt; and brth_mthr_age between 15 and 41</FONT>
<BR><FONT SIZE=3D2>&gt; group by brth_mthr_res_newco_code;</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; I am going to try the sums in a outer =
query.&nbsp; </FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; -----Original Message-----</FONT>
<BR><FONT SIZE=3D2>&gt; Sent: Wednesday, August 07, 2002 4:45 PM</FONT>
<BR><FONT SIZE=3D2>&gt; To: Stankus, Paula G; =
'ORACLE-L@fatcity.com'</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; Mother's state 80% are in Florida.&nbsp; =
However, this is</FONT>
<BR><FONT SIZE=3D2>&gt; a 'local' prefixed</FONT>
<BR><FONT SIZE=3D2>&gt; bitmap index.&nbsp; I would expect to use year =
to</FONT>
<BR><FONT SIZE=3D2>&gt; eliminate partion. then w/in</FONT>
<BR><FONT SIZE=3D2>&gt; year by state - second col. in query.</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; -----Original Message-----</FONT>
<BR><FONT SIZE=3D2>&gt; Sent: Wednesday, August 07, 2002 4:35 PM</FONT>
<BR><FONT SIZE=3D2>&gt; To: Stankus, Paula G; =
'ORACLE-L@fatcity.com'</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; BTW,</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; SQL&gt; select blocks from dba_tables</FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp; 2&nbsp; where table_name =3D =
'MV_BIRTHSTAT';</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp; BLOCKS</FONT>
<BR><FONT SIZE=3D2>&gt; ----------</FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp; 236542</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; SQL&gt; select clustering_factor from =
user_indexes</FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp; 2&nbsp; where =
table_name=3D'MV_BIRTHSTAT';</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; CLUSTERING_FACTOR</FONT>
<BR><FONT SIZE=3D2>&gt; -----------------</FONT>
<BR><FONT =
SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp; 1657</FONT>
<BR><FONT =
SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp; 170</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; -----Original Message-----</FONT>
<BR><FONT SIZE=3D2>&gt; Sent: Wednesday, August 07, 2002 4:28 PM</FONT>
<BR><FONT SIZE=3D2>&gt; To: Stankus, Paula G; =
'ORACLE-L@fatcity.com'</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; Help - weird performance problem!!!</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt;</FONT>
<BR><FONT =
SIZE=3D2>---------------------------------------------------------------=
-------------</FONT>
<BR><FONT SIZE=3D2>&gt; ----</FONT>
<BR><FONT SIZE=3D2>&gt; | =
Operation&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp; Name&nbsp;&nbsp;&nbsp; =
|&nbsp; Rows |</FONT>
<BR><FONT SIZE=3D2>&gt; Bytes|&nbsp; Cost&nbsp; | Pstart|</FONT>
<BR><FONT SIZE=3D2>&gt; Pstop |</FONT>
<BR><FONT SIZE=3D2>&gt;</FONT>
<BR><FONT =
SIZE=3D2>---------------------------------------------------------------=
-------------</FONT>
<BR><FONT SIZE=3D2>&gt; ----</FONT>
<BR><FONT SIZE=3D2>&gt; | SELECT =
STATEMENT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
|&nbsp;&nbsp;&nbsp;&nbsp; 1 |&nbsp;&nbsp; </FONT>
<BR><FONT SIZE=3D2>&gt; 5 |&nbsp;&nbsp; 9331 =
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |</FONT>
<BR><FONT SIZE=3D2>&gt; |</FONT>
<BR><FONT SIZE=3D2>&gt; |&nbsp; SORT =
AGGREGATE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
|&nbsp;&nbsp;&nbsp;&nbsp; 1 |&nbsp;&nbsp; </FONT>
<BR><FONT SIZE=3D2>&gt; 5 |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |</FONT>
<BR><FONT SIZE=3D2>&gt; |</FONT>
<BR><FONT SIZE=3D2>&gt; |&nbsp;&nbsp; SORT =
AGGREGATE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
|&nbsp;&nbsp;&nbsp;&nbsp; 1 |&nbsp;&nbsp; </FONT>
<BR><FONT SIZE=3D2>&gt; 5 |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |</FONT>
<BR><FONT SIZE=3D2>&gt; |</FONT>
<BR><FONT SIZE=3D2>&gt; |&nbsp;&nbsp;&nbsp; INLIST =
ITERATOR&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp; </FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp; =
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |</FONT>
<BR><FONT SIZE=3D2>&gt; |</FONT>
<BR><FONT SIZE=3D2>&gt; |&nbsp;&nbsp;&nbsp;&nbsp; PARTITION RANGE =
ITERAT|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp; </FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp; =
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |KEY(I)</FONT>
<BR><FONT SIZE=3D2>&gt; |KEY(I) |</FONT>
<BR><FONT SIZE=3D2>&gt; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; BITMAP =
CONVERSION COU|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp; </FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp; =
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |</FONT>
<BR><FONT SIZE=3D2>&gt; |</FONT>
<BR><FONT SIZE=3D2>&gt; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; BITMAP =
INDEX RANGE S|NDX_MVYRS |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
|&nbsp;&nbsp;&nbsp; </FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp; =
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |KEY(I)</FONT>
<BR><FONT SIZE=3D2>&gt; |KEY(I) |</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; Cost higher but less than a second.</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; Ignore the cost - higher cost was sign.</FONT>
<BR><FONT SIZE=3D2>&gt; Faster!!!!!Does Key(*) mean it is</FONT>
<BR><FONT SIZE=3D2>&gt; doing part. Elimin.&nbsp; I think so but can =
you see the</FONT>
<BR><FONT SIZE=3D2>&gt; inlist?</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; Very fast with all years involved.&nbsp; Then =
added</FONT>
<BR><FONT SIZE=3D2>&gt; predicate:</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; select</FONT>
<BR><FONT SIZE=3D2>&gt; /*+ INDEX(mv_birthstat,ndx_mvyrstatecoage) =
*/</FONT>
<BR><FONT SIZE=3D2>&gt; count(*) from mv_birthstat</FONT>
<BR><FONT SIZE=3D2>&gt; where cert_chld_brth_year</FONT>
<BR><FONT SIZE=3D2>&gt; in('1995','1996','1997','1998','1999')</FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp; and brth_MTHR_res_STATE_CODE =
=3D '10';</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; - snails crawl by just adding the =
additional</FONT>
<BR><FONT SIZE=3D2>&gt; column!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
</P>
<BR>

<P><FONT =
SIZE=3D2>__________________________________________________</FONT>
<BR><FONT SIZE=3D2>Do You Yahoo!?</FONT>
<BR><FONT SIZE=3D2>Yahoo! Health - Feel better, live better</FONT>
<BR><FONT SIZE=3D2><A HREF=3D"http://health.yahoo.com" =
TARGET=3D"_blank">http://health.yahoo.com</A></FONT>
<BR><FONT SIZE=3D2>-- </FONT>
<BR><FONT SIZE=3D2>Please see the official ORACLE-L FAQ: <A =
HREF=3D"http://www.orafaq.com" =
TARGET=3D"_blank">http://www.orafaq.com</A></FONT>
<BR><FONT SIZE=3D2>-- </FONT>
<BR><FONT SIZE=3D2>Author: Jack Silvey</FONT>
<BR><FONT SIZE=3D2>&nbsp; INET: jack_silvey@yahoo.com</FONT>
</P>

<P><FONT SIZE=3D2>Fat City Network Services&nbsp;&nbsp;&nbsp; -- (858) =
538-5051&nbsp; FAX: (858) 538-5051</FONT>
<BR><FONT SIZE=3D2>San Diego, =
California&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Public Internet =
access / Mailing Lists</FONT>
<BR><FONT =
SIZE=3D2>---------------------------------------------------------------=
-----</FONT>
<BR><FONT SIZE=3D2>To REMOVE yourself from this mailing list, send an =
E-Mail message</FONT>
<BR><FONT SIZE=3D2>to: ListGuru@fatcity.com (note EXACT spelling of =
'ListGuru') and in</FONT>
<BR><FONT SIZE=3D2>the message BODY, include a line containing: UNSUB =
ORACLE-L</FONT>
<BR><FONT SIZE=3D2>(or the name of mailing list you want to be removed =
from).&nbsp; You may</FONT>
<BR><FONT SIZE=3D2>also send the HELP command for other information =
(like subscribing).</FONT>
</P>

</BODY>
</HTML>
------_=_NextPart_001_01C23EEA.F48484B0--
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: 
  INET: Paula_Stankus@doh.state.fl.us

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru@fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

