FireDAC.Comp.Client.TFDQuery.IndexesActive
Delphi
property IndexesActive;
C++
__property IndexesActive = {default=1};
Contents
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
property | published | FireDAC.Comp.Client.pas FireDAC.Comp.Client.hpp |
FireDAC.Comp.Client | TFDQuery |
Description
Controls the automatic maintenance of indexes.
FireDAC.Comp.Client.TFDQuery.IndexesActive inherits from FireDAC.Comp.DataSet.TFDDataSet.IndexesActive. All content below this line refers to FireDAC.Comp.DataSet.TFDDataSet.IndexesActive.
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;