zoukankan      html  css  js  c++  java
  • group by 替代distinct

    SQL> select distinct employee_id,first_name from test1;
    
    107 rows selected.
    
    
    Execution Plan
    ----------------------------------------------------------
    Plan hash value: 255531131
    
    ------------------------------------------------------------------------------------
    | Id  | Operation	   | Name  | Rows  | Bytes |TempSpc| Cost (%CPU)| Time	   |
    ------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT   |	   |  6647K|   158M|	   | 67481   (1)| 00:13:30 |
    |   1 |  HASH UNIQUE	   |	   |  6647K|   158M|   229M| 67481   (1)| 00:13:30 |
    |   2 |   TABLE ACCESS FULL| TEST1 |  6647K|   158M|	   | 19570   (1)| 00:03:55 |
    ------------------------------------------------------------------------------------
    
    Note
    -----
       - dynamic sampling used for this statement (level=2)
    
    
    Statistics
    ----------------------------------------------------------
    	  4  recursive calls
    	  0  db block gets
         142133  consistent gets
          71297  physical reads
    	  0  redo size
           2749  bytes sent via SQL*Net to client
    	496  bytes received via SQL*Net from client
    	  9  SQL*Net roundtrips to/from client
    	  0  sorts (memory)
    	  0  sorts (disk)
    	107  rows processed
    
    
    SQL> select employee_id,first_name from test1 group by employee_id,first_name;
    
    107 rows selected.
    
    
    Execution Plan
    ----------------------------------------------------------
    Plan hash value: 1431305903
    
    ----------------------------------------------------------------------------
    | Id  | Operation	   | Name  | Rows  | Bytes | Cost (%CPU)| Time	   |
    ----------------------------------------------------------------------------
    |   0 | SELECT STATEMENT   |	   |  6647K|   158M| 19781   (2)| 00:03:58 |
    |   1 |  HASH GROUP BY	   |	   |  6647K|   158M| 19781   (2)| 00:03:58 |
    |   2 |   TABLE ACCESS FULL| TEST1 |  6647K|   158M| 19570   (1)| 00:03:55 |
    ----------------------------------------------------------------------------
    
    Note
    -----
       - dynamic sampling used for this statement (level=2)
    
    
    Statistics
    ----------------------------------------------------------
    	  4  recursive calls
    	  0  db block gets
         142133  consistent gets
          71297  physical reads
    	  0  redo size
           2749  bytes sent via SQL*Net to client
    	496  bytes received via SQL*Net from client
    	  9  SQL*Net roundtrips to/from client
    	  0  sorts (memory)
    	  0  sorts (disk)
    	107  rows processed

  • 相关阅读:
    JavaScript
    格式与布局
    表单和样式表
    HTML中表格的使用
    HTML 基础
    foreach使用和函数
    20160423 二维数组,锯齿数组和集合
    【学习笔记】系统集成项目管理
    BSEG和BSIS、BSAS、BSID、BSAD、BSIK、BSAK六个表的关系(转)
    关于ABAP事件的一张图
  • 原文地址:https://www.cnblogs.com/zhaoyangjian724/p/3798106.html
Copyright © 2011-2022 走看看