View previous topic :: View next topic |
Author |
Message |
MarkTrubo Contributor
Joined: 27 May 2001 Posts: 148 Location: Long Island, NY
|
Posted: Mon Dec 19, 2005 8:24 pm Post subject: Need to speed up my search.... |
|
|
I have a program that does a customer look-up by entering some search term or based on the called ID. It builds a list of records with the match and then a bunch of other stuff happens. There are a few thousand customer records and the searches can take a few seconds. I want it faster. Here is the code at the search point:
Code: | :BUTTON1BUTTON
REM FIRST
DIALOG SET,LIST2,Searching...
DIALOG CURSOR,WAIT
list clear,13
LIST SEEK,9,0
%%SEARCHME = @DLGTEXT(EDIT7)
REPEAT
%M = @MATCH(9,%%SEARCHME)
IF @EQUAL(%M,1)
LIST ADD,13,@ITEM(9)
END
%%TEMP = @NEXT(9)
UNTIL @NOT(@OK()) |
And here is the header and 1 record sample from the data:
ID|PGRPCOUNT|LOGIN|PW_EMAIL|PASSWORD|SHIP_FNAME|SHIP_LNAME|SHIP_EMAIL|SHIP_COMP|SHIP_PHONE|SHIP_FAX|SHIP_ADDR|SHIP_CITY|SHIP_STATE|SHIP_ZIP|SHIP_CNTRY|BILL_FNAME|BILL_LNAME|BILL_EMAIL|BILL_COMP|BILL_PHONE|BILL_FAX|BILL_ADDR|BILL_CITY|BILL_STATE|BILL_ZIP|BILL_CNTRY
XXX1XXX|0|marktrubo|mark@directglove.com|mypassword|Mark|Trubowitsch|mark@directglove.com|Direct Glove|800-434-0012|800-434-0013|485-18 South Broadway|Hicksville|NY|11801|US|Mark|Trubowitsch|mark@directglove.com|Direct Glove|800-434-0012|800-434-0013|485-18 South Broadway|Hicksville|NY|11801|US
The odd thing is if the search is on some term with lots of matches, it is really quick, like I just did one that had 3,106 matches and it took like 1 second. But if there are only a few matches, it takes like 30 seconds.
What can I do to speed this up? Can I do soemthing with the String DLL or something else?
Thanks! |
|
Back to top |
|
|
MarkTrubo Contributor
Joined: 27 May 2001 Posts: 148 Location: Long Island, NY
|
|
Back to top |
|
|
Dr. Dread Professional Member
Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Tue Dec 20, 2005 9:31 am Post subject: |
|
|
Just sent ya a mail stating the possibilities.
Greetz
Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
Back to top |
|
|
MarkTrubo Contributor
Joined: 27 May 2001 Posts: 148 Location: Long Island, NY
|
Posted: Tue Dec 20, 2005 11:28 am Post subject: |
|
|
I did what you said -- now I need what you promised! |
|
Back to top |
|
|
Dr. Dread Professional Member
Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Tue Dec 20, 2005 1:19 pm Post subject: |
|
|
Didn't you get It
Greetz
Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
Back to top |
|
|
MarkTrubo Contributor
Joined: 27 May 2001 Posts: 148 Location: Long Island, NY
|
Posted: Tue Dec 20, 2005 1:27 pm Post subject: |
|
|
Yip -- already playing with it -- it is FAST on the match!!! |
|
Back to top |
|
|
Dr. Dread Professional Member
Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Tue Dec 20, 2005 2:01 pm Post subject: |
|
|
Great.
Please bear in mind that this is a beta, so report any instability etc.
If your source file isn't changing all the time, you could also consider the new FileOpsRes range of functions.
FileOpsRes will keep the file loaded between function calls and thus it will be much faster when doing repeated
operations on the same file.
Greetz
Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
Back to top |
|
|
MarkTrubo Contributor
Joined: 27 May 2001 Posts: 148 Location: Long Island, NY
|
Posted: Tue Dec 20, 2005 8:13 pm Post subject: |
|
|
That option looks cool -- I will play with it. |
|
Back to top |
|
|
marty Professional Member
Joined: 10 May 2001 Posts: 789
|
Posted: Wed Dec 21, 2005 1:01 pm Post subject: |
|
|
Ah! Ha! That is a feature that seem to interest me !
Can't wait for the new version! |
|
Back to top |
|
|
|