SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict isuru's Avatar
    Join Date
    Nov 2000
    Posts
    206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If there were 20 fields in a table and you wanted to select only 2 fields you do something like:

    "SELECT <field1>, <field2> FROM <tablename>"

    you would NOT use:
    "SELECT * FROM <tablename>"
    because it would decrease performance.

    BUT say if you wanted to select 19 of the 20 fields.
    would you use:
    a) "SELECT * FROM <tablename>"
    b) "SELECT <field1>,<field2>,<field3>... FROM <tablename>"

    is there much performance difference?
    Option b) might involve a lot of typing!

  2. #2
    SitePoint Addict Chris Roane's Avatar
    Join Date
    Jul 1999
    Location
    Helena, MT
    Posts
    287
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    I would say that it would probably be best just to use option a, just because there isn't going to be much time lost at all.

    Chris Roane

  3. #3
    AdSpeed.com Son Nguyen's Avatar
    Join Date
    Aug 2000
    Location
    Silicon Valley
    Posts
    2,241
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm not sure 100% but I believe they do make a difference when you have huge amount of data/fields
    Most often it doesn't matter if it's a small table
    - Son Nguyen
    AdSpeed.com - Ad Serving and Ad Management Made Easy


Bookmarks

Posting Permissions

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