473,396 Members | 2,021 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Any suggestions to improve this query performance

Hi group,

I have a query as follows.

SELECT * FROM ACS$USG_EVENT, ACS$USG_EVENTDETAIL WHERE
ACS$USG_EVENTDETAIL.PARENTCANONICALID = ACS$USG_EVENT.CANONICALID;

both the tables are analyzed and default optimizer is CBO. I use 8i
under winnt. The estimate is as follows

ID STEP_DESCRIPTION
---------- --------------------------------------------------
0 SELECT STATEMENT COST = 284431
1 MERGE JOIN
2 TABLE ACCESS BY INDEX ROWID ACS$USG_EVENT
3 INDEX FULL SCAN ACS$CAT_USAGEEVENT_PKEY
4 SORT JOIN
5 TABLE ACCESS FULL ACS$USG_EVENTDETAIL
It takes more than six minutes to obtain the result. FYI,
ACS$USG_EVENTDETAIL has around 900,000 records and ACS$USG_EVENT has
550,000 records.

Any suggestions on which the query can be improved ?
TIA and regards

Pramod Ramachandran
Jul 19 '05 #1
2 4291
pr****@rtimes.com (Pramod Ramachandran) wrote in message news:<66**************************@posting.google. com>...
Hi group,

I have a query as follows.

SELECT * FROM ACS$USG_EVENT, ACS$USG_EVENTDETAIL WHERE
ACS$USG_EVENTDETAIL.PARENTCANONICALID = ACS$USG_EVENT.CANONICALID;

both the tables are analyzed and default optimizer is CBO. I use 8i
under winnt. The estimate is as follows

ID STEP_DESCRIPTION
---------- --------------------------------------------------
0 SELECT STATEMENT COST = 284431
1 MERGE JOIN
2 TABLE ACCESS BY INDEX ROWID ACS$USG_EVENT
3 INDEX FULL SCAN ACS$CAT_USAGEEVENT_PKEY
4 SORT JOIN
5 TABLE ACCESS FULL ACS$USG_EVENTDETAIL
It takes more than six minutes to obtain the result. FYI,
ACS$USG_EVENTDETAIL has around 900,000 records and ACS$USG_EVENT has
550,000 records.

Any suggestions on which the query can be improved ?
TIA and regards

Pramod Ramachandran


1. this really should be asked in comp.databases.oracle.misc since
this group, comp.databases.oracle is defunct.
2. since you are doing "SELECT *" I suspect there isn't much more to
do. if the ACS$USG_EVENT table has matches for all its rows, you
return over half a million rows. If you are waiting to display the
results, you might add a FIRST_ROWS hint.

Does ACS$USG_EVENT have a PRIMARY KEY? Does ACS$USG_EVENTDETAIL have a
primary key, or index on the ACS$USG_EVENTDETAIL.PARENTCANONICALID
attribute? I might have thought the full scan and index scan might be
reversed, but I really don't see much that can help this. The SELECT *
forces a read of the entire row from both tables eventually.

Unless there is something special about your data, you are stuck. If
there is something special, you might be able to partition the query
into parts and run the parts in parallel.

(Remember the DB adage: know thy data.)
HTH
ed
Jul 19 '05 #2
In most cases a hash join might be more efficient than a merge join.
The question is why is the CBO not using that instead?

In 8i, let's see the values for these parameters:
HASH_JOIN_ENABLED
HASH_AREA_SIZE
SORT_AREA_SIZE

Also test if you could hint a hash join and yield better performance.
We only wanna test; it's always better to let the CBO decide without
using hints.

Cheers,

Romeo

pr****@rtimes.com (Pramod Ramachandran) wrote in message news:<66**************************@posting.google. com>...
Hi group,

I have a query as follows.

SELECT * FROM ACS$USG_EVENT, ACS$USG_EVENTDETAIL WHERE
ACS$USG_EVENTDETAIL.PARENTCANONICALID = ACS$USG_EVENT.CANONICALID;

both the tables are analyzed and default optimizer is CBO. I use 8i
under winnt. The estimate is as follows

ID STEP_DESCRIPTION
---------- --------------------------------------------------
0 SELECT STATEMENT COST = 284431
1 MERGE JOIN
2 TABLE ACCESS BY INDEX ROWID ACS$USG_EVENT
3 INDEX FULL SCAN ACS$CAT_USAGEEVENT_PKEY
4 SORT JOIN
5 TABLE ACCESS FULL ACS$USG_EVENTDETAIL
It takes more than six minutes to obtain the result. FYI,
ACS$USG_EVENTDETAIL has around 900,000 records and ACS$USG_EVENT has
550,000 records.

Any suggestions on which the query can be improved ?
TIA and regards

Pramod Ramachandran

Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: ALex_1998 | last post by:
Hi Dear All, I have a large query as below: select count (distinct b.bus_acct_id) from M_DATE M1, M_BIZ_ACCT M2, BIZ_ACCT B, C_PRDT_PKG C
2
by: Ryan | last post by:
We have an MIS system which has approx 100 reports. Each of these reports can take up to several minutes to run due to the complexity of the queries (hundreds of lines each in most cases). Each...
3
by: Leader | last post by:
Hi All, I am getting slower performance of select statements in MS SQL. I am finding select statements in MS SQL are even slower than MS ACCESS. Is there any way to improve the performance of...
2
by: Jaidev Paruchuri | last post by:
I have a table called work_order which has over 1 million records and a contractor table which has over 3000 records. When i run this query ,it takes long time since its grouping by contractor...
7
by: Bing Wu | last post by:
Hi Folks, I have a very large table containing 170 million rows of coordinats: CREATE TABLE "DB2ADMIN"."COORDINATE" ( "FID" INTEGER NOT NULL , "AID" INTEGER NOT NULL , "X" REAL NOT NULL ,...
8
by: Michael C | last post by:
Anyone have any hints on improving the performance of C# UI? I'm filling a TreeView and ListView with information returned by a SQLDataReader and information read from the Registry. I'm working...
2
by: lelandhuang | last post by:
I am developing reporting service and using lots of 'LEFT OUTER JOIN', I am worried about the performance and want to use some subquery to improve the performance. Could I do that like below, ...
3
by: oravm | last post by:
Hi, I re-write a query and used bulk collect to improve the performance of the batch process. The query below has NO compile error but when execute query there is error 'ORA-01403: no data...
2
by: Pramod Ramachandran | last post by:
Hi group, I have a query as follows. SELECT * FROM ACS$USG_EVENT, ACS$USG_EVENTDETAIL WHERE ACS$USG_EVENTDETAIL.PARENTCANONICALID = ACS$USG_EVENT.CANONICALID; both the tables are analyzed...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.