# Impressions / Select

  • I have a database of doctors that can be searched by users. I would like to implement a statistics page for each doctor which includes "Total impressions in search results"

    I have a rather complicated search (SELECT) query to search for these doctors. How would i implement functionality to increment a counter on a doctor's record only when the doctor appears in search results? I could issue an UPDATE statement with the same params as the search query, but that would have the performance hit of essentially re-running the query. Any ideas?

    tx - matt

  • Hi,

    You can use a another table with columns doctorid,searchcount which should be updated on each search and it will improve the performance; since transaction act on another table.

    Reagrds

    varun R

    http://www.sqlinfo.in

  • yes, but HOW to update - re-run the same params as the SELECT query only as an UPDATE query? that seems arduous, and database and processor intensive.

    varunfilim (7/19/2010)


    Hi,

    You can use a another table with columns doctorid, searchcount which should be updated on each search and it will improve the performance; since transaction act on another table.

    Reagrds

    varun R

    http://www.sqlinfo.in[/quote%5D

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply