|
Re: Perfomace issues on complex query [message #200798 is a reply to message #200788] |
Wed, 01 November 2006 06:38 |
michael_bialik
Messages: 621 Registered: July 2006
|
Senior Member |
|
|
Hi.
A number of questions:
1. How many rows do you have in FMIS_OWNER.FMIS_BFG_CUSTOMERS table ?
2. How many of them having
FMIS_OWNER.FMIS_BFG_CUSTOMERS.CUS_BOR_ID = 2 ?
3. Do you have an index on CUS_BOR_ID column (or an index having that column as FIRST index column)?
4. How many rows the query actually selects?
|
|
|
|
Re: Perfomace issues on complex query [message #200830 is a reply to message #200788] |
Wed, 01 November 2006 08:55 |
michael_bialik
Messages: 621 Registered: July 2006
|
Senior Member |
|
|
1. About my last questions:
Do you jave an idea how many rows your original query is going to select?
2. I would recommend using an index:
CREATE INDEX ... ON FMIS_OWNER.FMIS_BFG_CUSTOMERS (CUS_BOR_ID).
Can you try such an index and post EXPLAIN plan?
I expect optimizer to utilize it and to see the FMIS_BFG_CUSTOMERS as a driving table of your query.
3. Can you specify what are the relations between following tables ( 1:1 or 1:many):
FMIS_INVENTORY_LISTING - FMIS_SITE_SERVICES (based on ssv_id)
FMIS_INVENTORY_LISTING - FMIS_NTN_NTNS (based on element_id)
FMIS_INVENTORY_LISTING - INVENTORY_SUPPLIERS (sup_id)
FMIS_INVENTORY_LISTING - FMIS_PACKAGE_INSTANCES (pi_id)
FMIS_INVENTORY_LISTING - FMIS_INV_STATUS4 (sta_id)
FMIS_SITE_SERVICES - FMIS_CONTRACT_SERVICES (csv_id)
FMIS_CONTRACT_SERVICES - CONTRACTS_CUS (con_id)
|
|
|
Re: Perfomace issues on complex query [message #200852 is a reply to message #200830] |
Wed, 01 November 2006 11:41 |
artmt
Messages: 32 Registered: October 2006 Location: Boston
|
Member |
|
|
I doubt the index would make a difference. The table is fairly small and the index returning 3.6% of the rows may not be selective enough.
Looking at the optimizer cardinality estimates I suspect many to many joins.
Art
|
|
|
|
Re: Perfomace issues on complex query [message #200875 is a reply to message #200788] |
Wed, 01 November 2006 14:14 |
michael_bialik
Messages: 621 Registered: July 2006
|
Senior Member |
|
|
Can you run following queries and post the results:
1. SELECT COUNT(*) CNTR, COUNT(DISTINCT SIT_ID )
FROM FMIS_OWNER.FMIS_INVENTORY_LISTING
2. SELECT COUNT(*) CNTR, COUNT(DISTINCT SSV_ID)
FROM FMIS_OWNER.FMIS_SITE_SERVICES
3. SELECT COUNT(*) CNTR, COUNT(DISTINCT CSV_ID)
FROM FMIS_OWNER.FMIS_CONTRACT_SERVICES
4. SELECT COUNT(*) CNTR, COUNT(DISTINCT CON_ID)
FROM FMIS_OWNER.FMIS_OWNER_CONTRACTS_CUS
5. SELECT COUNT(*) CNTR, COUNT(DISTINCT NTN_NTN_ID2)
FROM FMIS_OWNER.FMIS_NTN_NTNS
6. SELECT COUNT(*) CNTR, COUNT(DISTINCT SUP_ID)
FROM INVENTORY_SUPPLIERS
7. SELECT COUNT(*) CNTR, COUNT(DISTINCT PI_ID)
FROM FMIS_OWNER.FMIS_PACKAGE_INSTANCES
8. SELECT COUNT(*) CNTR, COUNT(DISTINCT STA_ID)
FROM FMIS_OWNER_FMIS_INV_STATUS4
|
|
|
|
|
|