Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2002
    Posts
    84

    Red face Unanswered: Help: algorithm...

    i have a table, prod, with fields of id, name, keyword and date.

    my program is doing something like this:

    1. use a search engine to search for keyword, and a vector
    of id is returned.

    2. connec to db to get all the prod records one by one, given
    the vector of id.

    3. sort the prod records by date and then name.

    the most time consuming part is Step 2 and Step3. that is why
    i am thinking of using SQL with LIKE clause to replace the steps.
    however, it is still a bit slow due to LIKE clause.

    is there any solution for it, e.g. some search engine with sorting
    feature?

    thanks.

  2. #2
    Join Date
    Apr 2003
    Location
    Tunisia
    Posts
    192

    Thumbs up Cool code

    You code get rid of this by :
    1- Using functions and so doing many queries in just one query.
    2- using views so you can spare time while dealing with the data.
    3- Using triggers to do autoimatic treatement on table(s)
    Open up
    Take a look to my Blog http://www.rundom.com/karim2k

  3. #3
    Join Date
    Apr 2002
    Posts
    84

    Talking Re: Cool code

    thanks for the information.

    > 1- Using functions and so doing many queries in just
    > one query.
    one sql query, no problem. but the like clause in the
    query takes time to execute, given more than 200k
    records and 5000-char length of keywords.

    > 2- using views so you can spare time while dealing with
    > the data.
    i was thinking of using view, but the query is dynamic,
    accepting any keyword string to be search. can we still
    use view in this case?

    > 3- Using triggers to do autoimatic treatement on table(s)
    > [/SIZE]
    what kind of triggers, like vacuum? could you elaborate a
    bit more about this?

    thank you very much for all the help...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •