- 最后登录
- 2015-3-26
- 在线时间
- 21 小时
- 威望
- 29
- 金钱
- 264
- 注册时间
- 2012-6-14
- 阅读权限
- 10
- 帖子
- 27
- 精华
- 0
- 积分
- 29
- UID
- 506
|
1#
发表于 2015-3-26 12:05:45
|
查看: 4002 |
回复: 2
SQL> SELECT * FROM SINFO_GZGTFGJ.VIEW_PROJ_LM WHERE (街道名称 LIKE '%海中南约%');
no rows selected
Elapsed: 00:00:07.93
Execution Plan
----------------------------------------------------------
Plan hash value: 2218180510
----------------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes |TempSpc| Cost (%CPU)| Time |
----------------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 280K| 285M| | 129K (1)| 00:25:52 |
| 1 | VIEW | VIEW_PROJ_LM | 280K| 285M| | 129K (1)| 00:25:52 |
| 2 | SORT UNIQUE | | 280K| 139M| 156M| 129K (1)| 00:25:52 |
| 3 | UNION-ALL | | | | | | |
|* 4 | TABLE ACCESS FULL | LM | 280K| 139M| | 98234 (1)| 00:19:39 |
|* 5 | FILTER | | | | | | |
| 6 | TABLE ACCESS FULL| LM | 65 | 23595 | | 5 (0)| 00:00:01 |
----------------------------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
4 - filter(SYS_OP_C2C("JDMC") LIKE '%海中南约%')
5 - filter('' LIKE '%海中南约%')
Statistics
----------------------------------------------------------
0 recursive calls
1 db block gets
406713 consistent gets
405810 physical reads
0 redo size
768 bytes sent via SQL*Net to client
349 bytes received via SQL*Net from client
1 SQL*Net roundtrips to/from client
1 sorts (memory)
0 sorts (disk)
0 rows processed
CREATE OR REPLACE FORCE VIEW "SINFO_GZGTFGJ"."VIEW_PROJ_LM" ("CODE", "房屋编号",
"街道代码", "街道名称", "街坊名称", "权利人名称", "坐落", "门牌号", "建筑名称", "数据位置")
AS
SELECT
LBH AS CODE,
TO_CHAR(FWBH) AS 房屋编号,
TO_CHAR(JDDM) AS 街道代码,
TO_CHAR(JDMC) AS 街道名称,
TO_CHAR(JFMC) AS 街坊名称,
TO_CHAR(QLRMC) AS 权利人名称,
ZL AS 坐落,
MPH AS 门牌号,
JZWMC AS 建筑名称,
'正式库' AS 数据位置
FROM
LM
UNION
SELECT
LBH AS CODE,
'' AS 房屋编号,
'' AS 街道代码,
'' AS 街道名称,
'' AS 街坊名称,
'' AS 权利人名称,
ZL AS 坐落,
MPH AS 门牌号,
JZWMC AS 建筑名称,
'临时库' AS 数据位置
FROM
LM_T ;
SQL> select OWNER,OBJECT_NAME,OBJECT_TYPE from DBA_OBJECTS where OBJECT_NAME IN('LM','LM_T');
OWNER OBJECT_NAME OBJECT_TYPE
------------------------------ ------------------------------ -------------------
PUBLIC LM SYNONYM
SSDE LM TABLE
SINFO_GZGTFGJ LM SYNONYM
SINFO_GZGTFGJ LM_T SYNONYM
SSDE_T LM TABLE
SINFO_GZGTFGJ2 LM SYNONYM
SINFO_GZGTFGJ2 LM_T SYNONYM
7 rows selected.
CREATE OR REPLACE SYNONYM "SINFO_GZGTFGJ"."LM" FOR "SSDE"."LM";
CREATE OR REPLACE SYNONYM "SINFO_GZGTFGJ"."LM_T" FOR "SSDE_T"."LM";
SQL> select COUNT(*) from SSDE.LM;
COUNT(*)
----------
5607515
SQL> select COUNT(*) from SSDE_T.LM;
COUNT(*)
----------
68
SQL> select INDEX_NAME,COLUMN_NAME,COLUMN_POSITION,COLUMN_LENGTH from DBA_IND_COLUMNS
2 WHERE index_owner='SSDE' AND TABLE_NAME='LM' ORDER BY index_name,column_position;
INDEX_NAME COLUMN_NAME COLUMN_POSITION COLUMN_LENGTH
------------------------------ ------------------------------ --------------- -------------
A287_IX1 SHAPE 1 256
LBH LBH 1 72
R377_SDE_ROWID_UK OBJECTID 1 22
SQL> CREATE UNIQUE INDEX SSDE.LM_JDMC_ID ON SSDE.LM (JDMC, OBJECTID)
2 COMPRESS 1;
Index created.
SQL> SELECT
2 LBH AS CODE,
3 TO_CHAR(FWBH) AS 房屋编号,
4 TO_CHAR(JDDM) AS 街道代码,
5 TO_CHAR(JDMC) AS 街道名称,
6 TO_CHAR(JFMC) AS 街坊名称,
7 TO_CHAR(QLRMC) AS 权利人名称,
8 ZL AS 坐落,
9 MPH AS 门牌号,
10 JZWMC AS 建筑名称,
11 '正式库' AS 数据位置
12 from
13 SSDE.LM a where objectid in(select objectid from SSDE.LM b where (JDMC like '%海中南约%'));
no rows selected
Elapsed: 00:00:02.59
Execution Plan
----------------------------------------------------------
Plan hash value: 1652329195
--------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
--------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 117K| 59M| 98148 (1)| 00:19:38 |
|* 1 | TABLE ACCESS FULL| LM | 117K| 59M| 98148 (1)| 00:19:38 |
--------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
1 - filter("JDMC" IS NOT NULL AND "JDMC" LIKE
U'%\6D77\4E2D\5357\7EA6%')
Statistics
----------------------------------------------------------
1 recursive calls
1 db block gets
406759 consistent gets
0 physical reads
0 redo size
768 bytes sent via SQL*Net to client
349 bytes received via SQL*Net from client
1 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
0 rows processed
SQL> SELECT /*+ index(a R377_SDE_ROWID_UK) */
2 LBH AS CODE,
3 TO_CHAR(FWBH) AS 房屋编号,
4 TO_CHAR(JDDM) AS 街道代码,
5 TO_CHAR(JDMC) AS 街道名称,
6 TO_CHAR(JFMC) AS 街坊名称,
7 TO_CHAR(QLRMC) AS 权利人名称,
8 ZL AS 坐落,
9 MPH AS 门牌号,
10 JZWMC AS 建筑名称,
11 '正式库' AS 数据位置
12 from
13 SSDE.LM a where objectid in(select /*+ index(b LM_JDMC_ID) */ objectid from SSDE.LM b where (JDMC like '%海中南约%'));
no rows selected
Elapsed: 00:00:00.73
Execution Plan
----------------------------------------------------------
Plan hash value: 2430674811
------------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
------------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 117K| 59M| 20314 (1)| 00:04:04 |
| 1 | TABLE ACCESS BY INDEX ROWID| LM | 117K| 59M| 20314 (1)| 00:04:04 |
|* 2 | INDEX FULL SCAN | LM_JDMC_ID | 117K| | 12455 (1)| 00:02:30 |
------------------------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
2 - filter("JDMC" IS NOT NULL AND "JDMC" LIKE U'%\6D77\4E2D\5357\7EA6%')
Statistics
----------------------------------------------------------
0 recursive calls
0 db block gets
12380 consistent gets
0 physical reads
0 redo size
768 bytes sent via SQL*Net to client
349 bytes received via SQL*Net from client
1 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
0 rows processed |
|