sql tunning
文章平均质量分 78
ForKing_
这个作者很懒,什么都没留下…
展开
-
ORACLE 11G利用ACS解决bind peeking带来的问题
一、什么是ACS(adaptiver cursor sharing) Oracle通过绑定变量技术解决了SQL语句硬解析过多的问题,降低了资源的争用。但是绑定变量在引入cursor sharing,增加了软解析的同时,也带来了CBO环境下的bind peeking问题。 所谓bind peeking是指,oracle在第一次解析sql的时候,会“偷偷”地(pee转载 2013-08-23 22:55:57 · 778 阅读 · 0 评论 -
了解oracle Nestd loop join
--嵌套循环连接的使用情景Nested loop joins are useful when the following conditions are true:■ The database joins small subsets of data. ---与比较小的结果集进行连接■ The join condition is an efficient method of acce原创 2013-08-27 11:45:52 · 656 阅读 · 0 评论 -
oracle 使用rownum减少自定义函数的调用
ROWNUM Pseudocolumn --rownum 伪列For each row returned by a query, the ROWNUM pseudocolumn returns a number indicating the order in which Oracle selects the row from a table or set of joined row原创 2013-08-27 17:19:21 · 665 阅读 · 0 评论 -
oracle 使用rownum进行分页
wsx@ORCL> select * from v$version where rownum=1;BANNER--------------------------------------------------------------------------------Oracle Database 11g Enterprise Edition Release 11.2.0.1.原创 2013-08-27 19:45:55 · 795 阅读 · 0 评论 -
oracle 游标处理过程
打开游标:系统会在与这个会话相关的服务器进程的服务器端私有内存中为这个游标分配一个内存结构,也就是用户全局区解析游标:有一条sql语句与这个游标关联。解析后内容(包括执行计划)会被加载到共享池中的library cache。UGA的结构会被更新,以保存指向这个共享游标在库缓存中的位置。定义输出变量:如果sql语句返回数据,必须先定义接受数据的变量。这一点不仅对查询语句很重要对于原创 2013-08-27 23:23:41 · 642 阅读 · 0 评论 -
oracle 子查询解嵌套和谓词推入(sqlsubquery unnest and pre_push)
Subquery Unnesting In subquery unnesting, the optimizer transforms a nested queryinto an equivalent join statement, and then optimizes the join. This transformationenables the optimizer to ta原创 2013-08-27 23:32:14 · 1980 阅读 · 0 评论 -
过程化到基于集合的思想
案例:produce a list of all employees who spent the same number of years in each job they held within the company during their employment。hr@ORCL> select distinct employee_id 2 from job_history j1原创 2013-09-10 22:16:37 · 484 阅读 · 0 评论 -
oracle pivot and unpivot
pivotWe will begin with the new PIVOT operation. Most developers will be familiar with pivoting data: it is where multiple rows are aggregated and transposed into columns, with each column represe转载 2013-10-12 11:24:00 · 1207 阅读 · 0 评论 -
1.基数、直方图、集群因子
基数与选择性 基数(Cardinality) 列唯一键(Distinct_keys)的数量。 选择性(Selectivity) 列唯一键(Distinct_Keys)与行数(Num_Rows)的比值。原创 2014-11-16 21:42:30 · 528 阅读 · 0 评论