Search Algorithm - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Search Algorithm

G.ManivannanG.Manivannan Posts: 43Member
Hai,
I had done one Address Management program in Vb.Net 2005 and Ms-access 2000.
The database consists of only one table with 5000 records in fifteen fields.
I had given one search option to retrive the required data from database.
I didn't use any algorithm in the program.
Simply i had used select query for finding the record.

So that i causes time delay to retrive the record from the database.

I think if i use any Search alogrithm in my program,it will reduce the time delay.

If my idea is correct,please suggest me which alogorithm i can use and how can i implement it my program.




G.Manivannan, M.Sc.,[it],
VBA Programmer,
AKUVA Infotech, Bangalore.

Comments

  • zibadianzibadian Posts: 6,349Member
    : Hai,
    : I had done one Address Management program in Vb.Net 2005 and
    : Ms-access 2000.
    : The database consists of only one table with 5000 records in fifteen
    : fields.
    : I had given one search option to retrive the required data from
    : database.
    : I didn't use any algorithm in the program.
    : Simply i had used select query for finding the record.
    :
    : So that i causes time delay to retrive the record from the database.
    :
    : I think if i use any Search alogrithm in my program,it will reduce
    : the time delay.
    :
    : If my idea is correct,please suggest me which alogorithm i can use
    : and how can i implement it my program.
    :
    :
    :
    :
    : G.Manivannan, M.Sc.,[it],
    : VBA Programmer,
    : AKUVA Infotech, Bangalore.
    If your table is sorted on the field you're searching on, then a binary search algorithm is a good algorithm.
    If the field isn't sorted but a string, then you might consider adding some metadata to the table, and use the Rabin-karp string matching algoritm.
    Both these algoritms are well described on the wikipedia or in any good book on algorithms.
  • JonathanJonathan Posts: 2,914Member
    If you're trying to improve database performance, adding an index on the field named in your WHERE clause and/or any fields that are used in JOINs can make a dramatic difference. I sped a query up by a factor of more than 10 this weekend by doing this.

    Jonathan
    ###
    for(74,117,115,116){$::a.=chr};(($_.='qwertyui')&&
    (tr/yuiqwert/her anot/))for($::b);for($::c){$_.=$^X;
    /(p.{2}l)/;$_=$1}$::b=~/(..)$/;print("$::a$::b $::c hack$1.");
Sign In or Register to comment.