fvdwtfv18yy0m 士大夫士大夫 撒發順豐 select name,DATATYPE_STRING,VALUE_STRING from v$sql_bind_capture where sql_id='fvdwtfv18yy0m'; SELECT TABLE_NAME,COLUMN_NAME ...
fvdwtfv18yy0m
select * from table(dbms_xplan.display_awr('fvdwtfv18yy0m'));
SELECT cu.ecno,
cu.NAME,
cu.birthday,
cu.sex,
cu_id.idtype,
cu_id.idcard,
reg.username
FROM customer cu,
customerid cu_id,
customerreg reg
WHERE cu.ecno = cu_id.ecno
AND cu.ecno = reg.ecno
AND upper(reg.username) = upper('[email protected]');
SELECT INDEX_NAME FROM DBA_INDEXES WHERE TABLE_NAME ='CUSTOMERREG' ;
alter session set current_schema=ESERVICE;
士大夫士大夫
![](http://images2015.cnblogs.com/blog/1010978/201608/1010978-20160820011355640-470982857.png)
撒發順豐
CREATE TABLE "ESERVICE"."CUSTOMERREG"
( "ECNO" VARCHAR2(32) NOT NULL ENABLE,
"USERNAME" VARCHAR2(50),
"USERPASSWORD" VARCHAR2(50),
"CRANECARD" VARCHAR2(30),
"CREATEDATE" DATE,
"LOGONCOUNT" NUMBER(10,0),
"LASTLOGONDATE" DATE,
"ISUSE" VARCHAR2(1),
"CUSTOMERREG_LDAP_FLAG" VARCHAR2(10),
"RANDOMNO" VARCHAR2(20),
"LASTSENDMAILDATE" VARCHAR2(20),
"DAYLOGINCOUNT" VARCHAR2(1),
"DAYLOGINDATE" VARCHAR2(14),
PRIMARY KEY ("ECNO")
USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 19922944 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "ESERVICE" ENABLE,
CONSTRAINT "USERNAME" UNIQUE ("USERNAME")
USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 29360128 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "ESERVICE" ENABLE
) SEGMENT CREATION IMMEDIATE
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
NOCOMPRESS LOGGING
STORAGE(INITIAL 75497472 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "ESERVICE"
select name,DATATYPE_STRING,VALUE_STRING from v$sql_bind_capture where sql_id='fvdwtfv18yy0m';
-----------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
-----------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 15626 | 1449K| 12213 (1)| 00:02:27 |
|* 1 | HASH JOIN | | 15626 | 1449K| 12213 (1)| 00:02:27 |
|* 2 | HASH JOIN | | 15594 | 974K| 9806 (1)| 00:01:58 |
|* 3 | TABLE ACCESS FULL| CUSTOMERREG | 15594 | 517K| 5635 (1)| 00:01:08 |
| 4 | TABLE ACCESS FULL| CUSTOMER | 1489K| 42M| 4167 (1)| 00:00:51 |
| 5 | TABLE ACCESS FULL | CUSTOMERID | 1501K| 44M| 2402 (1)| 00:00:29 |
-----------------------------------------------------------------------------------
SELECT TABLE_NAME,COLUMN_NAME,INDEX_NAME FROM DBA_IND_COLUMNS WHERE TABLE_NAME IN ('CUSTOMER','CUSTOMERID','CUSTOMERREG');
TABLE_NAME COLUMN_NAME INDEX_NAME
------------------------------ ------------------------------ ------------------------------
CUSTOMER MOBILE IND_CUSTOMER
CUSTOMER ECNO SYS_C0015620
CUSTOMERID ECNO IDX_CUS_ID
CUSTOMERREG USERNAME USERNAME
CUSTOMERREG ECNO SYS_C0015621
IDX_CUS_ID表空間是USERS
create index eservice.ind_CUSTOMERREG_upperusername on eservice.CUSTOMERREG(upper('USERNAME')) tablespace EBDBINDEX;
---------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
---------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 15626 | 976K| 11775 (1)| 00:02:22 |
|* 1 | HASH JOIN | | 15626 | 976K| 11775 (1)| 00:02:22 |
|* 2 | HASH JOIN | | 15594 | 746K| 9370 (1)| 00:01:53 |
|* 3 | TABLE ACCESS FULL | CUSTOMERREG | 15594 | 517K| 5635 (1)| 00:01:08 |
| 4 | INDEX FAST FULL SCAN| SYS_C0015620 | 1489K| 21M| 3732 (1)| 00:00:45 |
| 5 | TABLE ACCESS FULL | CUSTOMERID | 1501K| 21M| 2401 (1)| 00:00:29 |
---------------------------------------------------------------------------------------
SELECT 1
FROM customer cu,
customerid cu_id,
customerreg reg
WHERE cu.ecno = cu_id.ecno
AND cu.ecno = reg.ecno
AND upper(reg.username) = upper('[email protected]');