'PERFORMANCE' is a relative thing; it can be measured but the numbers are only meaningful if you have previous numbers to compare them to.
RE - performance issues with existing queries
1. What are the indications that there is a performance issue? Is it really slow or did a user just report that 'it seems slow'? Does an existing query take substantially longer to run now than it did before?
2. What changes might have occured in the database that might have degraded performance? db upgrade? batch load of data into one of the tables? one or more missing or disabled indexes?
3. Are the statistics out of date? Indexes missing or disabled? Number of records in one ore more tables changed dramatically?
4. Compare the current execution plan with the excecution plan when the query performed satisfactorily (which many shops never bother to create and save). Is the same plan and joining being performed? Are the same indexess being used?
RE - performance issues for new queries
1. Gather info about how many records are in each table being queried. In your case: how many records are there in ITEM_CHART and MATERIAL tables?
2. Gather info about many records from each table are expected to be accessed. In your case: how many records in the MATERIAL table will have the parameter value :B1? 1% of the records? 40% of the records? How many records would you expect to be in the result table? Five? Fifty million?
3. ALWAYS create an execution plan. This tellsl you what Oracle expects to do to get the result. Look for problem areas such as CARTESIAN joins, excessive SORTs, indexes not being used.
4. Test the query on very small data sets to make sure it is performing the way you expect.
5. Once it performs well create another execution plan and save it for use in the future to troubleshoot performance and other issues.
I rarely look or even care about the actual statistics for a query. Oracle will generally do the best job possible based on the information it has available to it. So I focus on making sure I have given Oracle the best info possible and haven't left anything out.
One example:
Rows Execution Plan
0 SELECT STATEMENT MODE: ALL_ROWS
0 MERGE JOIN (CARTESIAN)
0 INDEX MODE: ANALYZED (SKIP SCAN) OF 'IDX_MATERIAL'
(INDEX)
0 BUFFER (SORT)
0 MAT_VIEW ACCESS MODE: ANALYZED (BY INDEX ROWID) OF
'ITEM_CHART' (MAT_VIEW)
0 INDEX MODE: ANALYZED (RANGE SCAN) OF
'IDX_ITEM_CHART' (INDEX)
When asking performance-related questions it is helpful if you provide the number of records in each table of the query and what indexes are available on them.
Assuming that you actually have a performance problem the likely reason is the CARTESIAN join that is being used.
Your execution plan shows 'MERGE JOIN (CARTESIAN)' which means that every row of ITEM_CHART is being joined to every row of MATERIAL.
This indicates that one or both of the join columns (ITEM_ID = B.MATL_NO) either do not have the proper index needed or it is not being used.
If one of the indexes is missing you need to add it.
If both indexes exist make sure they are enabled.
One main reason an index may not be used is if the statistics do not exist or are out of date.
分享到:
相关推荐
Oracle 19C是Oracle数据库的一个重要版本,OCP(Oracle Certified Professional)是Oracle公司针对其产品提供的专业认证,旨在证明个人在Oracle数据库管理、优化和运维方面的技能和知识。以下是对Oracle 19C OCP相关...
6. OracleHOME_NAMEDataGatherer:性能包数据采集服务,用于Oracle Capacity Planner和Oracle Performance Manager,收集性能数据。如果不使用这些性能监控工具,可以保持手动启动状态。 7. OracleHOME_...
### DAVE Oracle DG 学习笔记 #### DataGuard架构与背景 Oracle Data Guard(简称DG)是一种用于构建高可用性和灾难恢复解决方案的技术。它通过在主数据库(Primary Database)和辅助数据库(Standby Database)...
随着Oracle 11g的发布,性能调优的重点不再仅仅集中在提高缓存击中率上。Oracle Wait Interface(OWI)是基于等待事件的调优方法,它依赖于对一千多种等待事件的记录,帮助DBA快速识别和解决性能瓶颈。OWI方法论强调...
Oracle数据库提供了一系列动态性能视图(Dynamic Performance Views),也称为V$视图,它们提供了数据库运行时的统计信息,这些信息对于监控和诊断数据库问题至关重要。从提供的文件内容中,我们可以看到以下几个...
描述中提到的"SG"进一步解释为可能是原厂教材,也可能是Sybex出版的"OCP Oracle 9i Performance Tuning Study Guide"等四本书。这表明我们正在讨论的是关于Oracle数据库管理的高级主题,特别是性能调优。OCP(Oracle...
Oracle提供了一系列工具和视图,如V$视图、动态性能视图(Dynamic Performance Views)和企业管理器(Enterprise Manager),用于监控数据库性能,诊断和解决问题。 十、Oracle 12c及更高版本的新特性 Oracle 12c...
- DataGuard 支持三种不同的保护模式:Maximum Availability、Maximum Performance 和 Maximum Protection。 - 这些模式分别针对不同的业务需求,例如对高可用性的极端追求、性能优化或者数据完整性保护。 3. **...
Navigation Bar、Shopping Cart、Cross-Brower Support、Performance. 通过实际项目, 培养学生实战能力,包括系统分析、设计(包括功能需求分析、数据库设计、功能模块设计和详细设计)、开发、调试、测试和部署的能力...
价值一万八的中美 IT 培训笔记一万多培训费的资料,北京权威的.NET培训机构】 【认真学习后你一定能成为优秀的.net程序员】 学习对象:1.大专及大专以上理工科学历,或有相当学历的理工科教育背景 2.热爱...
Navigation Bar、Shopping Cart、Cross-Brower Support、Performance. 通过实际项目, 培养学生实战能力,包括系统分析、设计(包括功能需求分析、数据库设计、功能模块设计和详细设计)、开发、调试、测试和部署的能力...
5. **数据库资源管理**:Oracle的自动工作负载管理(Automatic Workload Repository, AWR)和动态性能视图(Dynamic Performance Views, V$视图)可以帮助监控数据库性能,并根据需要调整PGA和SGA内存、调度资源、...
在 MySQL 中,常见的关系型数据库包括 Oracle、SQL Server 和 DB2。 【数据库的创建与管理】 创建数据库可以使用 DDL(Data Definition Language)语句,例如 `CREATE DATABASE dbname;`。当数据库已存在时,尝试...
### DataGuard简明笔记 #### 一、基础知识 ##### (一) REDO 传输 **DataGuard**的核心机制之一就是**REDO**日志的传输与应用。在**Oracle DataGuard**环境中,**Primary**数据库负责生成并传输**REDO**日志至**...
1. **访问 Oracle 官方网站**:首先访问 Oracle 的 edelivery 网站 (http://edelivery.oracle.com),并选择“Oracle Enterprise Performance Management System”。 2. **下载安装包**:为本教程下载的是 32 位...