oracle10g - how to increase oracle query when 22,000,000 records in single table? -
I have Oracle 10G installed on Windows Server 2003. I have 22,000,000 records in a table and this is a transaction table,
About this table approximately 50,000 per month of the record.
My question is, whenever I run a query on this, my query is very slow, is there any way by which I can improve the performance of the query, such as table split or other ?
Query
Select a.prd_code, a.br_code || '-' || Br_title, a.size_code || '-' || Size_chitel, size_in_gomes, averkide || '-' var_title, a.form_code || '-' || Form_chirtle, a pockcode || '-' || Pack_title, a.pack_type_code || '-' || pack_type_title, start_date, end_date, a price, brand Br, (specific prd_code, br_code, size_code, var_code, form_code, packing_code selected a.price, cphistory the pack_type_code where prd_code = '01' flag = 'Y' and project_yy = '2009' and '01' and '10') CP, (prd_code, br_code, size_code, size_in_gms selection of sizes where prd_code = '01' and end_date = '31 -dec-2050 'flag =' Y ') SZ in (select prd_code, br_code, var_code, var_title of varient) vt, (select from prd_code, br_code, form_code, FORM_TITLE form) FM, PC (prd_code, package) Pack_title (select prd_code, Pakck_type to pack_type_title) pt where a.prd_code = br. prd_code and a.br_code = br_br_code and a.prd_code = sz.prd_code and a.br_code = SZ .br_code and a.size_code = sz.size_code and a.prd_code = vt.prd_code and a.br_code = vt.br_code and a. var_code = vt.var_code and a.prd_code = fm.prd_code and a.br_code = fm.br_code and a.form_code = fm.form_code and a.prd_code = pc.prd_code and r_code = pc.br_code and a.pack_code = pc .pack_code and a.prd_code = pt.prd_code and a.pack_type_code = pt.pack_type_code and end_date = '2009' and 'prd_code =' 01 'a.prd_code, order by a.br_code, A.size_code, a.var_code, a. Pack_code, a.form_code
The tables used in this query are:
Prices: More than 2.1 m rows cphistory: size more than 2.2M rows Are: more than 5000 Pt Tian brand: It varies more than 1200 lines: There are more than 1800 line package: more than 200 lines Pak_prkar: More than 150 lines
- Check out the index. Make sure that you have the primary key, the optional option key must be unique restriction and indexed.
- Run an Expansion Plan on questions and see how the adapter is running them. If you see a table scan, add the index.
- Make sure the adapter is using data to make its work easier.
- Take historical data in warehouses if necessary.
The 22m record is not very big.
Comments
Post a Comment