Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM General » View Thread |
Messages 1 to 7 of 7 total |
Faster way to delete without SQL |
Wed, Jan 24 2018 3:56 AM | Permanent Link |
Jose Eduardo Helminsky HPro Informatica | Which is faster:
Table.SetRange([<start>],[<end]>]); // <start> and <end> are the same Table.First; while not Table.Eof do begin Table.Delete; end; or while Table.FindKey([<key>]) do begin Table.Delete; end; Thanks in advance Eduardo |
Wed, Jan 24 2018 4:50 AM | Permanent Link |
Jose Eduardo Helminsky HPro Informatica | Sorry about my English
The correct question should be: The fastest way... |
Wed, Jan 24 2018 5:46 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Jose
The correct answer is .... SQL (probably) It really depends on a number of factors - table size, layout and organisation, wether the table is connected to visual controls or not. SQL - DELETE FROM table WHERE field BETWEEN ninvalue AND maxvalue Roy Lambert |
Wed, Jan 24 2018 6:22 AM | Permanent Link |
Jose Eduardo Helminsky HPro Informatica | Roy
I know SQL is the fastest way. My question is about of know the overhead of SetRange + While x FindKey. I think Tim is the person that will answer it with sure but my opinion is the method with FindKey is the fastest way Eduardo |
Wed, Jan 24 2018 7:58 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Jose
>My question is about of know the overhead of SetRange + While x FindKey. >I think Tim is the person that will answer it with sure but my opinion is the method with FindKey is the fastest way Slightly different question, and my money would be on SetRange. My logic goes FindKey has to traverse the index for every deletion, SetRange essentially creates a filter and then you're just moving through the filter picking up the next each time. I'm not sure if the filter would be regenerated after each delete which could have a major impact. Being insatiably curious is there a reason for the question or is it just curiosity? Roy |
Wed, Jan 24 2018 8:11 AM | Permanent Link |
Jose Eduardo Helminsky HPro Informatica | Roy Lambert wrote:
<< Being insatiably curious is there a reason for the question or is it just curiosity? >> It is just curiosity. Eduardo |
Fri, Jan 26 2018 12:24 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Eduardo,
<< Which is faster: >> The SetRange version is slightly faster because DBISAM doesn't need to traverse the (relatively shallow) depth of the index tree every time for the FindKey operation. Rather, it just tests index keys against the bounds of the range when navigating the leaf nodes of the index tree. Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Tuesday, April 30, 2024 at 03:55 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |