Subject RE: [IBO] InterBase Indexes, off topic sort of
Author Alan McDonald
I do this:
while not QIndexes.EOF do begin
CompStat.Caption := 'Deleting '+IntToStr(PBCount)+' old Indexes';
Preferences.Repaint;
IB_DSQLIndex.SQL.Clear;
IB_DSQLIndex.SQL.Add('alter index
'+QIndexes.FieldByName('RDB$INDEX_NAME').AsString+' inactive');
IB_DSQLIndex.ExecSQL;
Inc(PBPos);
PBMaint.Position := Round(PBPos/PBCount*100);
QIndexes.Next;
end;
QIndexes.First;
PBMaint.Position := 0;
PBPos := 0;
while not QIndexes.EOF do begin
CompStat.Caption := 'Creating '+IntToStr(PBCount)+' new Indexes';
Preferences.Repaint;
IB_DSQLIndex.SQL.Clear;
IB_DSQLIndex.SQL.Add('alter index
'+QIndexes.FieldByName('RDB$INDEX_NAME').AsString+' active');
IB_DSQLIndex.ExecSQL;
IB_DSQLIndex.SQL.Clear;
IB_DSQLIndex.SQL.Add('set statistics index
'+QIndexes.FieldByName('RDB$INDEX_NAME').AsString);
IB_DSQLIndex.ExecSQL;
Inc(PBPos);
PBMaint.Position := Round(PBPos/PBCount*100);
QIndexes.Next;
end;
QIndexes.Close;

where QIndexes SQL is
select rdb$index_name from rdb$indices where rdb$index_name not like 'RDB$%'


Alan


-----Original Message-----
From: David Husarik [mailto:davidhusarik@...]
Sent: Monday, 31 March 2003 11:54 AM
To: ibobjects
Subject: [IBO] InterBase Indexes, off topic sort of


Hi Group;

I think that I need to make indexes inactive prior to
reloading my database and then activate the indexes
after the reload is complete. What would be the best
way to make InterBase Indexes active or inactive. A
series of stored procedures called from a Delphi
program? A series of Queries called from a Delphi
program? Something else? I have 52 tables in the
database, each has 2 secondary indexes.

TIA,
David C. Husarik

__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com


___________________________________________________________________________
IB Objects - direct, complete, custom connectivity to Firebird or InterBase
without the need for BDE, ODBC or any other layer.
___________________________________________________________________________
http://www.ibobjects.com - your IBO community resource for Tech Info papers,
keyword-searchable FAQ, community code contributions and more !

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/