VIEW view ordered

view view ordered columns

Returns a ordered view on the first columns columns. All inserts and appends are kept sorted so when iterating over the view you don't have to explicitly sort. The find operation can be sped up significantly when finding a column that is kept sorted.

Examples

 # Create raw
 mk::view layout db.words {Name:S Phone:S}
 mk::view open db.words rawview
 # Create ordered view on raw
 set orderedview [rawview view ordered 1]

or

 # Create raw
 mk::view layout db.words {Name:S Phone:S}
 mk::view open db.words rawview
 # Create hash
 mk::view layout db.words_map {_H:I _R:I}
 mk::view open db.words_map hashview
 # Create ordered view on hash
 set orderedhashview [rawview view hash hashview]

Note, ordered views can be on top of hashed and blocked views.

TFW