NLS_SORT和NLS_COMP的设置影响性能
2010-03-04 20:00
260 查看
author:skate
time:2010/03/04
NLS_SORT和NLS_COMP的设置影响性能
通过设置这两个参数可以实现自定义的排序和比较的方式,虽然对写程序有优点,但他也会带来负面的影响
就是导致sql不走索引,而走全表扫描,当表的数据量很大是,非常影响性能
NLS_SORT和NLS_COMP是10g的新特性,大家在使用新特性的不要只考虑其优点,也要注意它带来的负面影响
NLS_SORT:
Setting NLS_SORT to anything other than BINARY causes a sort to use a full table scan,
regardless of the path chosen by the optimizer. BINARY is the exception because indexes
are built according to a binary order of keys. Thus the optimizer can use an index to
satisfy the ORDER BY clause when NLS_SORT is set to BINARY. If NLS_SORT is set to any
linguistic sort, the optimizer must include a full table scan and a full sort in the
execution plan.
Modifiable: ALTER SESSION SET NLS_SORT =''
Range of values: BINARY or any valid linguistic definition name
NLS_COMP :
specifies the collation behavior of the database session.
Values: { BINARY | LINGUISTIC | ANSI }
不同值说明
BINARY
Normally, comparisons in the WHERE clause and in PL/SQL blocks is binary unless you specify the NLSSORT function.
LINGUISTIC
Comparisons for all SQL operations in the WHERE clause and in PL/SQL blocks should use the linguistic sort specified
in the NLS_SORT parameter. To improve the performance, you can also define a linguistic index on the column for whichyou want linguistic comparisons.
ANSI
A setting of ANSI is for backwards compatibility; in general, you should set NLS_COMP to LINGUISTIC
参考文档:
http://www.hellodba.com/Cases/Improper_NLS_Parameter_case.htm
---end---
time:2010/03/04
NLS_SORT和NLS_COMP的设置影响性能
通过设置这两个参数可以实现自定义的排序和比较的方式,虽然对写程序有优点,但他也会带来负面的影响
就是导致sql不走索引,而走全表扫描,当表的数据量很大是,非常影响性能
NLS_SORT和NLS_COMP是10g的新特性,大家在使用新特性的不要只考虑其优点,也要注意它带来的负面影响
NLS_SORT:
Setting NLS_SORT to anything other than BINARY causes a sort to use a full table scan,
regardless of the path chosen by the optimizer. BINARY is the exception because indexes
are built according to a binary order of keys. Thus the optimizer can use an index to
satisfy the ORDER BY clause when NLS_SORT is set to BINARY. If NLS_SORT is set to any
linguistic sort, the optimizer must include a full table scan and a full sort in the
execution plan.
Modifiable: ALTER SESSION SET NLS_SORT =''
Range of values: BINARY or any valid linguistic definition name
NLS_COMP :
specifies the collation behavior of the database session.
Values: { BINARY | LINGUISTIC | ANSI }
不同值说明
BINARY
Normally, comparisons in the WHERE clause and in PL/SQL blocks is binary unless you specify the NLSSORT function.
LINGUISTIC
Comparisons for all SQL operations in the WHERE clause and in PL/SQL blocks should use the linguistic sort specified
in the NLS_SORT parameter. To improve the performance, you can also define a linguistic index on the column for whichyou want linguistic comparisons.
ANSI
A setting of ANSI is for backwards compatibility; in general, you should set NLS_COMP to LINGUISTIC
参考文档:
http://www.hellodba.com/Cases/Improper_NLS_Parameter_case.htm
---end---
相关文章推荐
- 小心NLS_SORT和NLS_COMP的设置成为性能杀手
- 【转】 小心NLS_SORT和NLS_COMP的设置成为性能杀手
- 小心NLS_SORT和NLS_COMP的设置成为性能杀手
- 小心NLS_SORT和NLS_COMP的设置成为性能杀手
- 小心NLS_SORT和NLS_COMP的设置成为性能杀手
- Sort_Buffer_Size 设置对服务器性能的影响
- Sort_Buffer_Size 设置对服务器性能的影响
- 影响计算机性能的设置
- TeraSort实验--测试Map和Reduce Task数量对Hadoop性能的影响
- Java JVM设置对性能的影响[转载]
- 浅析NLS_SORT、NLS_COMP( 二)
- TeraSort实验--测试Map和Reduce Task数量对Hadoop性能的影响
- JS-cookie的作用?如何操作cookie?设置cookie对性能的影响?
- CPU超频与电源设置对性能测试的影响
- TeraSort实验--测试Map和Reduce Task数量对Hadoop性能的影响
- Oracle数据库按中文拼音排序问题,NLS_SORT设置
- nls_comp和nls_sort
- 浅析NLS_SORT、NLS_COMP(-)
- NLS_SORT设置
- PermSize 设置过小对性能的影响(OutOfMemoryError:PermGen spac)