create index

Adaptive Server 15.7 SP100 includes changes to the create index command.

online

create index adds the online parameter, which lets you create indexes without blocking access to the data you are indexing. The syntax is:
create [unique] [clustered | nonclustered] index index_name
	on database.]owner.]table_name
	[with {...
			online,
	...}

sorted_data

You may execute parallel create index:
  • For a clustered index on a data-only-locked table (also called a placement index)
  • With the sorted_data clause
create index with sorted_data selects a parallel query plan only if you include an explicit consumers = clause. For example, Adaptive Server uses a parallel query plan for the first query, but uses a serial query plan for the second:
create index i1 on t1(c1) with sorted_data, consumers = N
create index i1 on t1(c1) with sorted_data
Note: Running query plans in serial allows Adaptive Server to dump the transaction log, maintaining recoverability. Running create index in parallel may cause the log records to become out of order, and you may not be able to dump the transaction log. Instead you must dump the database to maintain recoverability.

with statistics {no_hashing | new_hashing | hashing}]

Use the hash-based option and additional hash option clauses to gather index statistics on tables.

The with statistics hashing clauses are:
  • max_resource_granularity
  • histogram_tuning_factor
  • print_progress

The syntax is:

create [unique] [clustered | nonclustered] index index_name
	on database.]owner.]table_name
	[with {...
			[, statistics { no_hashing | new_hashing | hashing }]           
            [, statistics max_resource_granularity = int]
            [, statistics histogram_tuning_factor = int]             
            [, statistics print_progress = int] } ] 
	...}
Related concepts
Gathering Hash-Based Statistics with create index
sp_configure