【书评:Oracle查询优化改写】第三章

BLOG文档结构图

 

 

【书评:Oracle查询优化改写】第三章_Oracle

 

一.1  导读

各位技术爱好者,看完本文后,你可以掌握如下的技能,也可以学到一些其它你所不知道的知识,~O(∩_∩)O~:

① 隐含参数 _b_tree_bitmap_plans介绍

② 11g新特性Native Full Outer Join

 

 

 

本文如有错误或不完善的地方请大家多多指正,ITPUB留言或QQ皆可,您的批评指正是我写作的最大动力。

一.2  实验环境介绍

 

oracle:11.2.0.3  、8.1.7.0.0

OS: RHEL6.5

 

一.3  前言

 

前2章的链接参考相关连接:

 

【书评:Oracle查询优化改写】第一章 http://blog.itpub.net/26736162/viewspace-1652985/ 

【书评:Oracle查询优化改写】第二章 http://blog.itpub.net/26736162/viewspace-1654252/

 

 

昨天晚上(5.14)看完了《Oracle查询优化改写》的第三章,不得不说下这本书里边代码的排版有很大问题,格式老是不对齐,尤其是执行计划的格式,可能是印刷的时候出现的问题吧,不说这个了。这个第三章主要是讲多表的关联,包括各种连接的写法,如左联、右联,以及过滤条件错误地放在WHERE里会有什么影响;当数据有重复值时要直接关联还是分组汇总后再关联。

 

第 3 章 操作多个表

3.1 UNION ALL 与空字符串

3.2 UNION 与 OR

3.3 组合相关的行

3.4 IN、EXISTS 和 INNER JOIN

3.5 INNER JOIN、LEFT JOIN、RIGHT JOIN 和 FULL JOIN 解析

3.6 自关联

3.7 NOT IN、NOT EXISTS 和 LEFT JOIN

3.8 外连接中的条件不要乱放

3.9 检测两个表中的数据及对应数据的条数是否相同

3.10 聚集与内连接

3.11 聚集与外连接

3.12 从多个表中返回丢失的数据

3.13 多表查询时的空值处理

 

 

下边我就针对一些重点,或者说是我自己也不是很懂的部分做做研究吧。

 

一.4  隐含参数 _b_tree_bitmap_plans 实验

 

一.4.1  简介

该参数为隐含参数,是指是否将索引转换为   

 

 

 

 


 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

>

 

>

 

>

 

 

>

 

 

>

 

 

 

 

>

 

 

>

 

 

 

                                      

                                             

                           

                                                     

                                                                       

                                                   

                                   

                                                    

                                   

 

 

  

  

 

  

 

 

 

>

 

>

>

>

>

>

>

          

          

          

      

          

    

    

   

   

 

                                                                         

                

                                         

 

 

 

>

 

>

 

 

>

 

                                       

                    

>

 

 

>

 

 

                

                       

              

 

 

  

 

  

 

 

>

   

   

 

 

>

 

 

                                   

                                         

                                              

                                                                    

                         

                              

                         

                              

 

 

  

  

 

  

 

 

>

 

                          

          

 

>

 

 

 

>

 

 

>

 

 

                

                       

               

 

 

  

 

  

 

 

 

 

 

 

>

 

 

 

 

 

 

>

>

>

>

>

>

         

         

         

     

         

   

   

   

   

 

                                                                         

                 

                                         

 

 

>

 

 

 

>

 

 

>

 

 

>

 

 

>

>

>

 

    

     

 

 

                            

                            

                              

                                

                              

                                

 

 

 

 

          

          

          

          

          

          

          

          

          

          

          

 

>

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

>

 

 

                 

            

         

               

 

>

 

 

>

 

 

>

>

>

 

                                                                                                     

                                                                                             

                                                                             

                                                                               

                                                                                       

                                                                         

                                                                                       

                                                                                       

                                                                                       

                                                                                               

                                                                               

                                                                                           

                                                                                             

                                                                                         

                                                                                         

 

 

 

 

                    

                       

                                   

                                                     

                       

               

               

                          

               

                

 

 

  

  

 

  

 

 

        

          

         

          

          

       

        

          

          

          

         

 

>

 

                                                                                                     

                                                                                             

                                                                             

                                                                               

                                                                                       

                                                                         

                                                                                       

                                                                                       

                                                                                       

                                                                                               

                                                                               

                                                                                           

                                                                                             

                                                                                         

                                                                                         

 

 

 

 

                      

                         

                            

                     

                 

                 

 

 

  

 

  

 

 

          

          

         

          

          

       

        

          

          

          

         

 

>

>

>

>

>

>

         

         

         

     

         

   

   

   

   

 

                                                                         

     

          

 

 

>

 

 

 

 

 

 

 

 

 

 

 

 

>

 

 

>

 

 

>

 

 

>  

 

 

>

 

            

           

             

                

           

                  

 

 

                                                  

                                            

                                     

                                      

                                          

                                   

                                          

                                          

                                          

                                              

                                      

                                            

                                            

                                           

                                           

 

 

 

            

                  

           

 

>

 

 

 

                                                  

                                            

                                     

                                      

                                          

                                   

                                          

                                          

                       

                                              

                                      

                                            

                                            

                                           

                                           

 

 

> 

 

 

> 

 

            

                  

           

 

>

 

 

>

 

           

            

             

          

             

 

 

><

 

           

             

 

><

 

           

             

 

 

>

 

 

 

 

 

 

 

 

 

 

<>