在 SET EXPLAIN 输出中的外部表操作

SET EXPLAIN 的 Query Statistics 部分提供关于从外部表加载数据或将数据卸载到外部表的操作的信息。

SET EXPLAIN 输出文件的 Query Statistics 部分中的下列代码提供关于外部表的信息:

示例

下列示例展示一查询,其中的操作是从外部表加载数据并将数据插入到基础表内:

QUERY: (OPTIMIZATION TIMESTAMP: 11-11-2009 12:55:20)
------
insert into items select * from ext_items

Estimated Cost: 5
Estimated # of Rows Returned: 68

  1) gbasedbt.ext_items: SEQUENTIAL SCAN

Query statistics:
-----------------
  Table map :
  ----------------------------
  Internal name     Table name
  ----------------------------
  t1                items

  type     it_count   time
  ----------------------------
  xlread   1          00:00.00

  type     it_count   time
  ----------------------------
  xlcnv    67         00:00.00

  type     table  rows_ins   time
  -----------------------------------
  insert   t1     67         00:00.00

下列示例展示一查询,其中的操作是从基础表读数据并写到外部表指向的文件:

QUERY: (OPTIMIZATION TIMESTAMP: 11-11-2009 12:47:55)
------
select * from orders into external ord_ext
using (datafiles ('disk:/tmp/ord'))


Estimated Cost: 2
Estimated # of Rows Returned: 23

  1) gbasedbt.orders: SEQUENTIAL SCAN


Query statistics:
-----------------

  Table map :
  ----------------------------
  Internal name     Table name
  ----------------------------
  t1                orders

  type     table  rows_prod  est_rows  rows_scan  time       est_cost
  -------------------------------------------------------------------
  scan     t1     23         23        23         00:00.00   3

  type     it_count   time
  ----------------------------
  xucnv    23         00:00.00

  type     it_count   time
  ----------------------------
  xuwrite  23         00:00.00