Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9168227
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T15:34:49+00:00 2026-06-17T15:34:49+00:00

Possible Duplicate: select * vs select column I was just having a discussion with

  • 0

Possible Duplicate:
select * vs select column

I was just having a discussion with one of my colleague on the SQL Server performance on specifying the query command in the stored procedure.

So I want to know which one is preferred over another and whats the concrete reason behind that.

Suppose, We do have one table called
Employees(EmpName,EmpAddress)

And we want to select all the records from the table. So we can write the query in two ways,

  1. Select * from Employees

  2. Select EmpName, EmpAddress from Employees

So I would like to know is there any specific difference or performance issue in the above queries or are they just equal to the SQL Server Engine.

UPDATE:

  1. Lets say the table schema won’t change anymore. So no point for future maintenance.
  2. Performance wise, lets say, the usage is very very high i.e. millions of hits per seconds on the database server. I want a clear and precise performance rating on both approaches.
  3. No Indexing is done on the entire table.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T15:34:51+00:00Added an answer on June 17, 2026 at 3:34 pm

    I am an avid avokat of the “be as specific as possible” rule, too. Not following it will hurt you in the long run. However, your question seems to be coming from a different background, so let me attempt to answer it.


    When you submit a query to SQL Server it goes through several stages:

    1. transmitting of query string over the network.
    2. parsing of query string, producing a parse-tree
    3. linking the referenced objects in the parse tree to existing objects
    4. optimizing based on statistics and row count/size estimates
    5. executing
    6. transmitting of result data over the network

    Let’s look at each one:

    1. The * query is a few bytes shorter, so step this will be faster
    2. The * query contains fewer “tokens” so this should(!) be faster
    3. During linking the list of columns need to be puled and compared to the query string. Here the “*” gets resolved to the actual column reference. Without access to the code it is impossible to say which version takes less cycles, however the amount of data accessed is about the same so this should be similar.
    4. -6. In these stages there is no difference between the two example queries, as they will both get compiled to the same execution plan.

    Taking all this into account, you will probably save a few nanoseconds when using the * notation. However, you example is very simplistic. In a more complex example it is possible that specifying as subset of columns of a table in a multi table join will lead to a different plan than using a *. If that happens we can be pretty certain that the explicit query will be faster.

    The above comparison also assumes that the SQL Server process is running alone on a single processor and no other queries are submitted at the same time. If the process has to yield during the compilation those extra cycles will be far more than the ones we are trying to save.

    So, the amont of saving we are talking about is very minute compared to the actual execution time and should not be used as an excuse for a “bad” coding practice.

    I hope this answers your question.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: MySql select format, round column When i make a SQL query using
Possible Duplicate: SQL Server: Can I Comma Delimit Multiple Rows Into One Column? I
Possible Duplicate: Writing an SQL query to SELECT item from the following table I
Possible Duplicate: oracle PL/SQL: sort rows I run this query: Select a.product, sum( case
Possible Duplicate: SQL exclude a column using SELECT * [except columnA] FROM tableA? Hi
Possible Duplicate: SQL: Select dynamic column name based on variable I have the following
Possible Duplicate: Get just the Date from grouping in select from DateTime column in
Possible Duplicate: SQL exclude a column using SELECT * [except columnA] FROM tableA? I
Possible Duplicate: Change Notification with Sql Server 2008 Am just wondering is there's anyway
Possible Duplicate: Sanitize table/column name in Dynamic SQL in .NET? (Prevent SQL injection attacks)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.