Autor Beitrag
SnergleTheDwarf
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 19



BeitragVerfasst: Di 13.08.02 11:10 
hi,

mal wieder ein kleinigkeit ...

hab mir schon mehrere beträge angesehen ... zum thema speed, aber so richtig hab ich nichts gefunden was ich anwenden kann ...

also folgendes Problem:
ich mach ne abfrage auf ne dbase db und will dann die gewählten ds löschen. bisher mache ich es so:
ausblenden Quelltext
1:
2:
3:
4:
5:
  while (not (Query1.Eof)) do
  begin
    Query1.Delete;
    Inc(i);
  end;

mit dem problem, daß es sehr langsam läuft, sprich ca 10000 ds ca 5-8 min. sollte ich hier lieber so vorgehen, daß ich das löschen direkt per sql abfrage mache ? wäre aber etwas ungünstig, zumindest aus momentaner sicht.

ne idee die mir grad kommt:

Delete from <table> where (select * from <table> where <...>)


wäre das vielleicht ne möglichkeit ... gleich mal testen ...
trotzdem sind weitere hinweise sehr willkommen ...

mfg
snergle
Steffer
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 299



BeitragVerfasst: Di 13.08.02 11:55 
2 Möglichkeiten:
Wenn du einen exklusiven Zugriff hast, geht auch Query.EmptyTable;

Sonst
'Delete from Datenbank' als SQL.Text
Oder nur Teile löschen
'Delete from Datenbank WHERE ..'

_________________
Keine Signatur ...
SnergleTheDwarf Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 19



BeitragVerfasst: Di 13.08.02 15:32 
Titel: Fehler gefunden ...
Ich wollte mittels query1.recordcount den fortschritt ermiteln ... deshlab wird es langsam ... nutze jetzt nen counter ... das funzt besser ...

danke für die hilfe ..[/b]
SnergleTheDwarf Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 19



BeitragVerfasst: Di 13.08.02 15:33 
Titel: Fehler gefunden ...
Ich wollte mittels query1.recordcount den fortschritt ermiteln ... deshlab wird es langsam ... nutze jetzt nen counter ... das funzt besser ...

danke für die hilfe ...
Steffer
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 299



BeitragVerfasst: Di 13.08.02 16:59 
Mit RecordCount sollte man auch ein bischen sparsam sein.
Bei jedem Aufruf wird die ganze DB durchlaufen...

Aber probier mal die anderen beiden Varianten. Da kannst du dir jede Progressbar etc. sparen. :wink:

_________________
Keine Signatur ...