如题所述
èªå¨è½¬æ¢çï¼ä½æ¯NVARCHAR2ä¼å
级é«ç¹ï¼æ以éå°where varchar2 =nvarchar2çï¼ä¼å°varchar2èªå¨è½¬ä¸ºnvarchar2
SQL> drop table t;
Table dropped
SQL> create table t(name nvarchar2(100));
Table created
SQL> insert into t values('abc');
1 row inserted
SQL> explain plan for
2 select * from t where name='abc';
Explained
SQL> select * from table(dbms_xplan.display);
PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------
Plan hash value: 1601196873
--------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
--------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 102 | 3 (0)| 00:00:01 |
|* 1 | TABLE ACCESS FULL| T | 1 | 102 | 3 (0)| 00:00:01 |
--------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
1 - filter("NAME"=U'abc')
Note
-----
- dynamic sampling used for this statement (level=2)
17 rows selected
SQL> drop table t;
Table dropped
SQL> create table t(name varchar2(100));
Table created
SQL> insert into t values('abc');
1 row inserted
SQL> select * from t where name=u'abc';
NAME
--------------------------------------------------------------------------------
abc
SQL> explain plan for
2 select * from t where name=u'abc';
Explained
SQL> select * from table(dbms_xplan.display);
PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------
Plan hash value: 1601196873
--------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
--------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 52 | 3 (0)| 00:00:01 |
|* 1 | TABLE ACCESS FULL| T | 1 | 52 | 3 (0)| 00:00:01 |
--------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
1 - filter(SYS_OP_C2C("NAME")=U'abc')
Note
-----
- dynamic sampling used for this statement (level=2)
17 rows selected
SQL> drop table t;
Table dropped
SQL> create table t(name nvarchar2(100));
Table created
SQL> insert into t values('abc');
1 row inserted
SQL> explain plan for
2 select * from t where name='abc';
Explained
SQL> select * from table(dbms_xplan.display);
PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------
Plan hash value: 1601196873
--------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
--------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 102 | 3 (0)| 00:00:01 |
|* 1 | TABLE ACCESS FULL| T | 1 | 102 | 3 (0)| 00:00:01 |
--------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
1 - filter("NAME"=U'abc')
Note
-----
- dynamic sampling used for this statement (level=2)
17 rows selected
SQL> drop table t;
Table dropped
SQL> create table t(name varchar2(100));
Table created
SQL> insert into t values('abc');
1 row inserted
SQL> select * from t where name=u'abc';
NAME
--------------------------------------------------------------------------------
abc
SQL> explain plan for
2 select * from t where name=u'abc';
Explained
SQL> select * from table(dbms_xplan.display);
PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------
Plan hash value: 1601196873
--------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
--------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 52 | 3 (0)| 00:00:01 |
|* 1 | TABLE ACCESS FULL| T | 1 | 52 | 3 (0)| 00:00:01 |
--------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
1 - filter(SYS_OP_C2C("NAME")=U'abc')
Note
-----
- dynamic sampling used for this statement (level=2)
17 rows selected
温馨提示:答案为网友推荐,仅供参考