zoukankan      html  css  js  c++  java
  • 关于group by

    <pre name="code" class="sql">关于group by 排序问题
    
    10g 以前sort group by  需要排序
    
    10g 以后 hash group by 不需要排序
    SQL> set linesize 200
    SQL> set pagesize 200
    SQL> set autot trace
    SQL> select owner,count(*) from t1 group by owner;
    
    已选择30行。
    
    
    执行计划
    ----------------------------------------------------------
    Plan hash value: 136660032
    
    ---------------------------------------------------------------------------
    | Id  | Operation	   | Name | Rows  | Bytes | Cost (%CPU)| Time	  |
    ---------------------------------------------------------------------------
    |   0 | SELECT STATEMENT   |	  |    30 |   180 |  2014   (2)| 00:00:25 |
    |   1 |  HASH GROUP BY	   |	  |    30 |   180 |  2014   (2)| 00:00:25 |
    |   2 |   TABLE ACCESS FULL| T1   |   580K|  3403K|  1998   (1)| 00:00:24 |
    ---------------------------------------------------------------------------
    
    
    统计信息
    ----------------------------------------------------------
    	  0  recursive calls
    	  0  db block gets
           8323  consistent gets
           8313  physical reads
    	  0  redo size
           1059  bytes sent via SQL*Net to client
    	426  bytes received via SQL*Net from client
    	  3  SQL*Net roundtrips to/from client
    	  0  sorts (memory)
    	  0  sorts (disk)
    	 30  rows processed

    
                                        
    
  • 相关阅读:
    [考试]20150811
    [考试]20150810
    [随笔]暑假过了,暑假来了
    [考试]20150808
    动态规划大合集II
    [知识点][旧版]C++中的运算符
    NOIP动态规划大合集
    [考试]20150729
    [考试]20150728
    /=============分隔线=============/
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13352284.html
Copyright © 2011-2022 走看看