Results 1 to 2 of 2

Thread: Faster approach for querying

  1. #1
    Junior Member
    Join Date
    Jan 2008
    Answers
    1

    Faster approach for querying

    Which will be faster approach, querying one time or many times into database?

    I'm a programmer and always follow the standard method to access database like getting all records at once in recordset and then playing with it. But it takes times to load data having thousands of records(in my case takes upto 31 secs).

    Now I heard that it will be faster if we query the database many times to retrieve records when required(or some records). Also by doing so It will takes only few seconds to get the same job done. But only difference is that I am querying the database multiple times

    To summarize, should we query once or multiple times for achieving the goal without hampering the system and importantly application?
    Which way is better?

    Thanks in advance..


  2. #2
    Moderator
    Join Date
    Jun 2007
    Answers
    2,074

    Re: Faster approach for querying

    The answer is "it depends"

    It is always better to query the database less number of times and fetch from buffer.

    But if you have proper indexing then u can query the database more . BUt it is still recommended to go for less database calls to avoid excess disc I/O.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact