FireDAC.Comp.DataSet.TFDDataSet.IndexesActive

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property IndexesActive: Boolean read FIndexesActive write SetIndexesActive default True;

C++

__property bool IndexesActive = {read=FIndexesActive, write=SetIndexesActive, default=1};

Properties

Type Visibility Source Unit Parent
property public
FireDAC.Comp.DataSet.pas
FireDAC.Comp.DataSet.hpp
FireDAC.Comp.DataSet TFDDataSet

Description

Controls the automatic maintenance of indexes.

Use IndexesActive to indicate whether the dataset should maintain the data views defined by the Indexes collection. 

When IndexesActive is False, the dataset does not maintain the data views. That avoids the overhead of updating views while data is fetched or is edited. When IndexesActive is True (default value), the dataset maintains the data views. 

When indexes are maintained, each of them can be the current index, selected by the TFDIndex.Selected or by IndexName properties. 

To selectively enable and disable data views rather than turning them all on or off at once, use the Active property of individual TFDIndex objects. These objects are available through the Indexes property. 

If the application needs to perform batch updates to the dataset, then set IndexesActive to False before the updates, and return to the original value after the updates. Also, see the BeginBatch and EndBatch methods.

Example

var
  lPrevIndsActive: Boolean;
...
lPrevIndsActive := FDQuery1.IndexesActive;
FDQuery1.IndexesActive := False;
try
  // perform updates here, without maintaining client views
finally
  FDQuery1.IndexesActive := lPrevIndsActive;
end;

See Also