IsSparse: Boolean;
IsSparse: boolean;
The IsSparse property returns whether sparse columns are used to store data
Available values:
True. Sparse columns are used. Sparse columns are regular columns that have an optimized storage for Null values. Sparse columns reduce the space required to store Null values, but more resources are spent to get values that are different from Null. Use sparse columns only if the saved space will be 20-40%.
False. Sparse columns are not used.
Executing the example requires that the repository contains a table with the T_ISSPARSE identifier.
Add links to the Db and Metabase system assemblies.
Sub UserProc;
Var
MB: IMetabase;
DSInst: IDatasetInstance;
DSModel: IDatasetModel;
Fields: IDatasetModelFields;
i: Integer;
Field: IDatasetModelField;
Begin
MB := MetabaseClass.Active;
// Get table
DSInst := MB.ItemById("T_ISSPARSE").Open(Null) As IDatasetInstance;
// Get table fields
DSModel := DSInst.Dataset;
Fields := DSModel.Fields;
For i := 0 To Fields.Count - 1 Do
Field := Fields.Item(i);
// Display names of the fields using
// sparse columns to store data
If Field.IsSparse Then
Debug.WriteLine(Field.Name);
End If;
End For;
End Sub UserProc;
After executing the example the console window displays names of the fields using sparse columns to store data.
The requirements and result of the Fore.NET example execution match with those in the Fore example.
Imports Prognoz.Platform.Interop.Db;
…
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
DSInst: IDatasetInstance;
DSModel: IDatasetModel;
Fields: IDatasetModelFields;
i: Integer;
Field: IDatasetModelField;
Begin
MB := Params.Metabase;
// Get table
DSInst := MB.ItemById["T_ISSPARSE"].Open(Null) As IDatasetInstance;
// Get table fields
DSModel := DSInst.Dataset;
Fields := DSModel.Fields;
For i := 0 To Fields.Count - 1 Do
Field := Fields.Item[i];
// Display names of the fields using
// sparse columns to store data
If Field.IsSparse Then
System.Diagnostics.Debug.WriteLine(Field.Name);
End If;
End For;
End Sub;
See also: