Results 1 to 7 of 7
  1. #1
    Join Date
    Sep 2011
    Posts
    47

    Unanswered: Is this kind of optimization is good ?

    I guess you all might me aware of "regex in programming language & not in db" and "like clause of mssql" , so in order to optimize my web app i have reduce the db hits and solved a problem, where i need to search a particular name of Service, to do this i have use regex, I could do the same thing just by using like clause of mssql but for the sake of optimization & scalability i have choose this approach , now i just wanted to know ,using this approach (reducing the db hits) will my web app be fast and scalable ?
    Last edited by navedjobs; 05-25-12 at 14:26. Reason: clearity

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    you used regex in your application code instead of calling the database with a LIKE query?

    please explain what your application code regex is operating on
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    No, because you have to stream all of the data across the network in order to do your regex search at the client.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  4. #4
    Join Date
    Sep 2011
    Posts
    47
    Quote Originally Posted by r937 View Post
    you used regex in your application code instead of calling the database with a LIKE query?

    please explain what your application code regex is operating on
    yes absolutely,

    regex:
    Code:
    ^service_Name_Variable.?
    i guess this is exactly similar to what db will do
    if you dont understand this regex please ask
    so, is this a good idea to scale a web app?

  5. #5
    Join Date
    Sep 2011
    Posts
    47
    Quote Originally Posted by blindman View Post
    No, because you have to stream all of the data across the network in order to do your regex search at the client.
    The catch over here is I m fetching the data from db only at 3 times
    1. when page loads
    2. when client perform edits
    3. when client saves additional info

    any other time like while searching , sorting etc. i m using the cache copy of which i fetched most recently , now i guess you understand why i m asking this question ?

  6. #6
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    How many records are you searching through?
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  7. #7
    Join Date
    Sep 2011
    Posts
    47
    Quote Originally Posted by blindman View Post
    How many records are you searching through?
    it can be hundreds or thousands

Tags for this Thread

Posting Permissions

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