www.webdeveloper.com
Results 1 to 2 of 2

Thread: Is this significantly faster?

  1. #1
    Join Date
    Jun 2006
    Location
    Under your bed
    Posts
    357

    Is this significantly faster?

    Say I could use either of these two queries:

    SELECT `name`, `age` FROM `people` WHERE `person_id` = '1';

    vs

    SELECT `name`, `age`, `address`, `email` FROM `people` WHERE `person_id` = '1';

    Would the first one be significantly faster?
    The better I get at programming, the more I appreciate arrays. Handy dandy things they are.

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,334
    I doubt there would be a measurable difference. Maybe if one of the additional fields in the second query contained large amounts of data, there would be some additional time needed on each row fetch to copy that data from the DB to the application memory -- but if you need that data, then you'll have to use that time anyway -- and if you don't need that data, then why would you want it in the query results in the first place?
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles