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_at_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_at_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_at_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_at_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_at_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_at_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).
Received on Wed Aug 07 2002 - 22:37:18 CDT