Home » RDBMS Server » Performance Tuning » how to increase a performance of a table in oracle 10g (merged)
|
|
|
Re: how to increase a performance of a table in oracle 10g [message #254022 is a reply to message #253900] |
Wed, 25 July 2007 09:42 |
sunil_v_mishra
Messages: 506 Registered: March 2005
|
Senior Member |
|
|
Anamika,
[1] How much time is taken by your query?
[2] Why you want to execute ?
select * from table;
[3] Why you dont have primary key ?
[4] Is this table is use for Dataware housing?
[5] Why your table is not normalize?
[6] As u are doing only select, i dont think any records are frequently updated in table and if so then table may be fragmented.
[7] If you don't want to change any thing in table designing then better to make partition table depending on some column value (i.e. on basis of year, month or some other column)
Note:--Your query is doing FTS (full table scan) so it will take time.
Regard
Sunilkumar
[Updated on: Wed, 25 July 2007 09:44] Report message to a moderator
|
|
|
|
please help me [message #254184 is a reply to message #253900] |
Thu, 26 July 2007 02:00 |
anamika_025
Messages: 81 Registered: July 2007 Location: Indore
|
Member |
|
|
m sending to you my table ..there is 6 lacs records...
RECEIPTD_KID VARCHAR2(7),
RECEIPTD_RECEIPTMID VARCHAR2(7),
RECEIPTD_TYPE VARCHAR2(7),
RECEIPTD_RECNO CHAR(11),
RECEIPTD_DATE CHAR(10),
RECEIPTD_TIME CHAR(11),
RECEIPTD_PTREGID VARCHAR2(7),
RECEIPTD_ADMDISCHID VARCHAR2(7),
RECEIPTD_SERVICEID VARCHAR2(7),
RECEIPTD_SERVGRPID VARCHAR2(7),
RECEIPTD_SUBSERVGRPID VARCHAR2(7),
RECEIPTD_TARIFFID VARCHAR2(7),
RECEIPTD_EMERYN CHAR(1),
RECEIPTD_PTCATID VARCHAR2(7),
RECEIPTD_DOCTORID VARCHAR2(7),
RECEIPTD_RATE NUMBER(8,2),
RECEIPTD_QTY NUMBER(3),
RECEIPTD_AMOUNT NUMBER(10,2),
RECEIPTD_SERVCHRG NUMBER(10,2),
RECEIPTD_STATUS CHAR(1),
RECEIPTD_CDATE CHAR(10),
RECEIPTD_CTIME CHAR(11),
RECEIPTD_CREMARK VARCHAR2(100),
RECEIPTD_TRANNO NUMBER(3))
i want to increase the performance of above table
what can i do? please help me..
i execute this query
Select * from tablename;
i want to improve the performance because it takes mow than 2 hours.
thanks and regards,
Anamika
|
|
|
|
|
|
Re: please help me [message #254244 is a reply to message #254238] |
Thu, 26 July 2007 05:04 |
anamika_025
Messages: 81 Registered: July 2007 Location: Indore
|
Member |
|
|
actually i m doing
select * from tablename where receiptd_date='12/12/2006';
but the performance is not good...
its take 00:00:47.87
tota records are 1037
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: how to increase a performance of a table in oracle 10g (merged) [message #254879 is a reply to message #254762] |
Sun, 29 July 2007 23:35 |
anamika_025
Messages: 81 Registered: July 2007 Location: Indore
|
Member |
|
|
THIS IS THE RESULT OF OUTPUT FILE..............
C:\>tkprof E:\oracle\product\10.2.0\admin\RND\udump\rnd_ora_2468.trc d:\report.t
xt explain=dev/dev sys=yes
TKPROF: Release 10.2.0.1.0 - Production on Mon Jul 30 09:57:13 2007
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Trace file: E:\oracle\product\10.2.0\admin\RND\udump\rnd_ora_2468.trc
Sort options: default
********************************************************************************
count = number of times OCI procedure was executed
cpu = cpu time in seconds executing
elapsed = elapsed time in seconds executing
disk = number of physical reads of buffers from disk
query = number of buffers gotten for consistent read
current = number of buffers gotten in current mode (usually for update)
rows = number of rows processed by the fetch or execute call
********************************************************************************
The following statement encountered a error during parse:
Alter session set time_statistics = true
Error encountered: ORA-02248
********************************************************************************
Alter session set sql_trace = true
call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 1 0.00 0.00 0 0 0 0
Execute 2 0.00 0.04 0 0 0 0
Fetch 0 0.00 0.00 0 0 0 0
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 3 0.00 0.04 0 0 0 0
Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: ALL_ROWS
Parsing user id: 55 (DEV)
********************************************************************************
Alter session set timed_statistics = true
call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 1 0.00 0.00 0 0 0 0
Execute 1 0.00 0.01 0 0 0 0
Fetch 0 0.00 0.00 0 0 0 0
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 2 0.00 0.01 0 0 0 0
Misses in library cache during parse: 1
Optimizer mode: ALL_ROWS
Parsing user id: 55 (DEV)
********************************************************************************
select obj#,type#,ctime,mtime,stime,status,dataobj#,flags,oid$, spare1,
spare2
from
obj$ where owner#=:1 and name=:2 and namespace=:3 and remoteowner is null
and linkname is null and subname is null
call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 1 0.00 0.00 0 0 0 0
Execute 1 0.00 0.02 0 0 0 0
Fetch 1 0.00 0.02 1 3 0 1
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 3 0.00 0.05 1 3 0 1
Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: CHOOSE
Parsing user id: SYS (recursive depth: 1)
Rows Row Source Operation
------- ---------------------------------------------------
1 TABLE ACCESS BY INDEX ROWID OBJ$ (cr=3 pr=1 pw=0 time=28556 us)
1 INDEX RANGE SCAN I_OBJ2 (cr=2 pr=1 pw=0 time=28524 us)(object id 37)
********************************************************************************
select t.ts#,t.file#,t.block#,nvl(t.bobj#,0),nvl(t.tab#,0),t.intcols,
nvl(t.clucols,0),t.audit$,t.flags,t.pctfree$,t.pctused$,t.initrans,
t.maxtrans,t.rowcnt,t.blkcnt,t.empcnt,t.avgspc,t.chncnt,t.avgrln,
t.analyzetime,t.samplesize,t.cols,t.property,nvl(t.degree,1),
nvl(t.instances,1),t.avgspc_flb,t.flbcnt,t.kernelcols,nvl(t.trigflag, 0),
nvl(t.spare1,0),nvl(t.spare2,0),t.spare4,t.spare6,ts.cachedblk,ts.cachehit,
ts.logicalread
from
tab$ t, tab_stats$ ts where t.obj#= :1 and t.obj# = ts.obj# (+)
call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 1 0.00 0.00 0 0 0 0
Execute 1 0.01 0.01 0 0 0 0
Fetch 1 0.00 0.01 1 4 0 1
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 3 0.01 0.02 1 4 0 1
Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: CHOOSE
Parsing user id: SYS (recursive depth: 1)
Rows Row Source Operation
------- ---------------------------------------------------
1 NESTED LOOPS OUTER (cr=4 pr=1 pw=0 time=11043 us)
1 TABLE ACCESS CLUSTER TAB$ (cr=3 pr=1 pw=0 time=11002 us)
1 INDEX UNIQUE SCAN I_OBJ# (cr=2 pr=1 pw=0 time=10933 us)(object id 3)
0 TABLE ACCESS BY INDEX ROWID TAB_STATS$ (cr=1 pr=0 pw=0 time=23 us)
0 INDEX UNIQUE SCAN I_TAB_STATS$_OBJ# (cr=1 pr=0 pw=0 time=11 us)(object id 709)
********************************************************************************
select /*+ rule */ bucket_cnt, row_cnt, cache_cnt, null_cnt, timestamp#,
sample_size, minimum, maximum, distcnt, lowval, hival, density, col#,
spare1, spare2, avgcln
from
hist_head$ where obj#=:1 and intcol#=:2
call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 1 0.00 0.00 0 0 0 0
Execute 60 0.00 0.00 0 0 0 0
Fetch 60 0.01 0.02 2 179 0 59
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 121 0.01 0.02 2 179 0 59
Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: RULE
Parsing user id: SYS (recursive depth: 2)
Rows Row Source Operation
------- ---------------------------------------------------
1 TABLE ACCESS BY INDEX ROWID HIST_HEAD$ (cr=3 pr=0 pw=0 time=66 us)
1 INDEX RANGE SCAN I_HH_OBJ#_INTCOL# (cr=2 pr=0 pw=0 time=35 us)(object id 257)
********************************************************************************
select i.obj#,i.ts#,i.file#,i.block#,i.intcols,i.type#,i.flags,i.property,
i.pctfree$,i.initrans,i.maxtrans,i.blevel,i.leafcnt,i.distkey,i.lblkkey,
i.dblkkey,i.clufac,i.cols,i.analyzetime,i.samplesize,i.dataobj#,
nvl(i.degree,1),nvl(i.instances,1),i.rowcnt,mod(i.pctthres$,256),
i.indmethod#,i.trunccnt,nvl(c.unicols,0),nvl(c.deferrable#+c.valid#,0),
nvl(i.spare1,i.intcols),i.spare4,i.spare2,i.spare6,decode(i.pctthres$,null,
null,mod(trunc(i.pctthres$/256),256)),ist.cachedblk,ist.cachehit,
ist.logicalread
from
ind$ i, ind_stats$ ist, (select enabled, min(cols) unicols,
min(to_number(bitand(defer,1))) deferrable#,min(to_number(bitand(defer,4)))
valid# from cdef$ where obj#=:1 and enabled > 1 group by enabled) c where
i.obj#=c.enabled(+) and i.obj# = ist.obj#(+) and i.bo#=:1 order by i.obj#
call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 1 0.00 0.00 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 1 0.00 0.00 0 3 0 0
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 3 0.00 0.00 0 3 0 0
Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: CHOOSE
Parsing user id: SYS (recursive depth: 1)
Rows Row Source Operation
------- ---------------------------------------------------
0 SORT ORDER BY (cr=3 pr=0 pw=0 time=417 us)
0 HASH JOIN OUTER (cr=3 pr=0 pw=0 time=388 us)
0 NESTED LOOPS OUTER (cr=3 pr=0 pw=0 time=79 us)
0 TABLE ACCESS CLUSTER IND$ (cr=3 pr=0 pw=0 time=70 us)
1 INDEX UNIQUE SCAN I_OBJ# (cr=2 pr=0 pw=0 time=33 us)(object id 3)
0 TABLE ACCESS BY INDEX ROWID IND_STATS$ (cr=0 pr=0 pw=0 time=0 us)
0 INDEX UNIQUE SCAN I_IND_STATS$_OBJ# (cr=0 pr=0 pw=0 time=0 us)(object id 711)
0 VIEW (cr=0 pr=0 pw=0 time=0 us)
0 SORT GROUP BY (cr=0 pr=0 pw=0 time=0 us)
0 TABLE ACCESS BY INDEX ROWID CDEF$ (cr=0 pr=0 pw=0 time=0 us)
0 INDEX RANGE SCAN I_CDEF2 (cr=0 pr=0 pw=0 time=0 us)(object id 51)
********************************************************************************
select name,intcol#,segcol#,type#,length,nvl(precision#,0),decode(type#,2,
nvl(scale,-127/*MAXSB1MINAL*/),178,scale,179,scale,180,scale,181,scale,182,
scale,183,scale,231,scale,0),null$,fixedstorage,nvl(deflength,0),default$,
rowid,col#,property, nvl(charsetid,0),nvl(charsetform,0),spare1,spare2,
nvl(spare3,0)
from
col$ where obj#=:1 order by intcol#
call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 1 0.00 0.00 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 25 0.00 0.00 0 3 0 24
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 27 0.00 0.00 0 3 0 24
Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: CHOOSE
Parsing user id: SYS (recursive depth: 1)
Rows Row Source Operation
------- ---------------------------------------------------
24 SORT ORDER BY (cr=3 pr=0 pw=0 time=195 us)
24 TABLE ACCESS CLUSTER COL$ (cr=3 pr=0 pw=0 time=168 us)
1 INDEX UNIQUE SCAN I_OBJ# (cr=2 pr=0 pw=0 time=26 us)(object id 3)
********************************************************************************
select type#,blocks,extents,minexts,maxexts,extsize,extpct,user#,iniexts,
NVL(lists,65535),NVL(groups,65535),cachehint,hwmincr, NVL(spare1,0),
NVL(scanhint,0)
from
seg$ where ts#=:1 and file#=:2 and block#=:3
call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 1 0.00 0.00 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 1 0.00 0.00 0 3 0 1
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 3 0.00 0.00 0 3 0 1
Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: CHOOSE
Parsing user id: SYS (recursive depth: 1)
Rows Row Source Operation
------- ---------------------------------------------------
1 TABLE ACCESS CLUSTER SEG$ (cr=3 pr=0 pw=0 time=66 us)
1 INDEX UNIQUE SCAN I_FILE#_BLOCK# (cr=2 pr=0 pw=0 time=28 us)(object id 9)
********************************************************************************
select col#, grantee#, privilege#,max(mod(nvl(option$,0),2))
from
objauth$ where obj#=:1 and col# is not null group by privilege#, col#,
grantee# order by col#, grantee#
call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 1 0.00 0.00 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 1 0.00 0.00 0 2 0 0
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 3 0.00 0.00 0 2 0 0
Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: CHOOSE
Parsing user id: SYS (recursive depth: 1)
Rows Row Source Operation
------- ---------------------------------------------------
0 SORT GROUP BY (cr=2 pr=0 pw=0 time=75 us)
0 TABLE ACCESS BY INDEX ROWID OBJAUTH$ (cr=2 pr=0 pw=0 time=39 us)
0 INDEX RANGE SCAN I_OBJAUTH1 (cr=2 pr=0 pw=0 time=27 us)(object id 103)
********************************************************************************
select grantee#,privilege#,nvl(col#,0),max(mod(nvl(option$,0),2))
from
objauth$ where obj#=:1 group by grantee#,privilege#,nvl(col#,0) order by
grantee#
call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 1 0.00 0.00 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 1 0.00 0.00 0 2 0 0
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 3 0.00 0.00 0 2 0 0
Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: CHOOSE
Parsing user id: SYS (recursive depth: 1)
Rows Row Source Operation
------- ---------------------------------------------------
0 SORT GROUP BY (cr=2 pr=0 pw=0 time=85 us)
0 TABLE ACCESS BY INDEX ROWID OBJAUTH$ (cr=2 pr=0 pw=0 time=45 us)
0 INDEX RANGE SCAN I_OBJAUTH1 (cr=2 pr=0 pw=0 time=32 us)(object id 103)
********************************************************************************
select con#,obj#,rcon#,enabled,nvl(defer,0)
from
cdef$ where robj#=:1
call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 1 0.00 0.00 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 1 0.00 0.00 0 1 0 0
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 3 0.00 0.00 0 1 0 0
Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: CHOOSE
Parsing user id: SYS (recursive depth: 1)
Rows Row Source Operation
------- ---------------------------------------------------
0 TABLE ACCESS BY INDEX ROWID CDEF$ (cr=1 pr=0 pw=0 time=43 us)
0 INDEX RANGE SCAN I_CDEF3 (cr=1 pr=0 pw=0 time=31 us)(object id 52)
********************************************************************************
select con#,type#,condlength,intcols,robj#,rcon#,match#,refact,nvl(enabled,0),
rowid,cols,nvl(defer,0),mtime,nvl(spare1,0)
from
cdef$ where obj#=:1
call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 1 0.00 0.00 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 1 0.00 0.00 0 2 0 0
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 3 0.00 0.00 0 2 0 0
Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: CHOOSE
Parsing user id: SYS (recursive depth: 1)
Rows Row Source Operation
------- ---------------------------------------------------
0 TABLE ACCESS BY INDEX ROWID CDEF$ (cr=2 pr=0 pw=0 time=36 us)
0 INDEX RANGE SCAN I_CDEF2 (cr=2 pr=0 pw=0 time=24 us)(object id 51)
********************************************************************************
select /*+ rule */ bucket, endpoint, col#, epvalue
from
histgrm$ where obj#=:1 and intcol#=:2 and row#=:3 order by bucket
call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 1 0.00 0.00 0 0 0 0
Execute 41 0.00 0.00 0 0 0 0
Fetch 41 0.01 0.05 12 123 0 695
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 83 0.01 0.05 12 123 0 695
Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: RULE
Parsing user id: SYS (recursive depth: 2)
Rows Row Source Operation
------- ---------------------------------------------------
8 SORT ORDER BY (cr=3 pr=1 pw=0 time=13821 us)
8 TABLE ACCESS CLUSTER HISTGRM$ (cr=3 pr=1 pw=0 time=13766 us)
1 INDEX UNIQUE SCAN I_OBJ#_INTCOL# (cr=2 pr=0 pw=0 time=28 us)(object id 252)
********************************************************************************
select *
from
t_receiptd where receiptd_date='12/12/2006'
call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 1 0.03 0.04 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 71 0.57 2.51 13317 13390 0 1037
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 73 0.60 2.56 13317 13390 0 1037
Misses in library cache during parse: 1
Optimizer mode: ALL_ROWS
Parsing user id: 55 (DEV)
Rows Row Source Operation
------- ---------------------------------------------------
1037 TABLE ACCESS FULL T_RECEIPTD (cr=13390 pr=13317 pw=0 time=1344006 us)
Rows Execution Plan
------- ---------------------------------------------------
0 SELECT STATEMENT MODE: ALL_ROWS
1037 TABLE ACCESS MODE: ANALYZED (FULL) OF 'T_RECEIPTD' (TABLE)
********************************************************************************
Alter session set sql_trace = false
call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 1 0.00 0.00 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 0 0.00 0.00 0 0 0 0
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 2 0.00 0.00 0 0 0 0
Misses in library cache during parse: 1
Optimizer mode: ALL_ROWS
Parsing user id: 55 (DEV)
********************************************************************************
OVERALL TOTALS FOR ALL NON-RECURSIVE STATEMENTS
call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 4 0.03 0.04 0 0 0 0
Execute 5 0.00 0.05 0 0 0 0
Fetch 71 0.57 2.51 13317 13390 0 1037
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 80 0.60 2.62 13317 13390 0 1037
Misses in library cache during parse: 4
Misses in library cache during execute: 1
OVERALL TOTALS FOR ALL RECURSIVE STATEMENTS
call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 11 0.00 0.00 0 0 0 0
Execute 110 0.01 0.06 0 0 0 0
Fetch 134 0.03 0.11 16 325 0 781
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 255 0.04 0.18 16 325 0 781
Misses in library cache during parse: 11
Misses in library cache during execute: 11
5 user SQL statements in session.
110 internal SQL statements in session.
115 SQL statements in session.
1 statement EXPLAINed in this session.
********************************************************************************
Trace file: E:\oracle\product\10.2.0\admin\RND\udump\rnd_ora_2468.trc
Trace file compatibility: 10.01.00
Sort options: default
1 session in tracefile.
5 user SQL statements in trace file.
110 internal SQL statements in trace file.
115 SQL statements in trace file.
15 unique SQL statements in trace file.
1 SQL statements EXPLAINed using schema:
DEV.prof$plan_table
Default table was used.
Table was created.
Table was dropped.
1079 lines in trace file.
330 elapsed seconds in trace file.
|
|
|
|
Goto Forum:
Current Time: Sat Nov 23 07:51:41 CST 2024
|