DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: which one is faster

  1. #1
    Join Date
    Dec 2002
    Posts
    110

    which one is faster

    Hi


    This is an interview question.

    which one is faster

    select * from table
    or
    select col1, col2 from table


    Bye

  2. #2
    Join Date
    May 2002
    Posts
    2,645
    "Bye" back is all you're probably going to get in response. No ideas or experimentation of your own?

    Bye

  3. #3
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    Define "faster".
    Jeff Hunter

  4. #4
    Join Date
    Aug 2002
    Location
    Colorado Springs
    Posts
    5,253
    I would say that the second SQL might be faster, because the table may have more columns than col1 and col2, and it could be that the result for the second query could be derived from an index scan or fast full index scan faster than a full tablescan could retrieve the "Select * ...".

    If the table has no other columns, then any difference would be absolutely minute and irrelevant. I'd regard "Select col1, col2 ..." as better practice than "Select * ..." though, for maintainability purposes.
    David Aldridge,
    "The Oracle Sponge"

    Senior Manager, Business Intelligence Development
    XM Satellite Radio
    Washington, DC

    Oracle ACE

Posting Permissions

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


Click Here to Expand Forum to Full Width