Monday, November 3, 2008

NLS_SORT

Property

Description

Parameter type

String

Syntax

NLS_SORT = { BINARY | linguistic_definition }

Default value

Derived from NLS_LANGUAGE

Modifiable

ALTER SESSION

Range of values

BINARY or any valid linguistic definition name

NLS_SORT specifies the collating sequence for ORDER BY queries.

· If the value is BINARY, then the collating sequence for ORDER BY queries is based on the numeric value of characters (a binary sort that requires less system overhead).

· If the value is a named linguistic sort, sorting is based on the order of the defined linguistic sort. Most (but not all) languages supported by the NLS_LANGUAGE parameter also support a linguistic sort with the same name.

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.

You must use the NLS_SORT operator with comparison operations if you want the linguistic sort behavior.

Note:

1. Query for the current value of the parameter

select name, value, isdefault, isses_modifiable, issys_modifiable,

isinstance_modifiable, isdeprecated, description

from v$parameter where upper(name) = ‘NLS_SORT’;

NAME

VALUE

IS

DEFAULT

ISSES_

MODIFIABLE

ISSYS_

MODIFIABLE

ISINSTANCE_

MODIFIABLE

IS

DEPRECATED

DESCRIPTION

nls_sort

TRUE

TRUE

FALSE

FALSE

FALSE

NLS linguistic definition name

Oracle initializatoin parameters

No comments:

Post a Comment