Don't Use SELECT *(dotnethitman.spaces.live.com)

submitted by misbaharefinmisbaharefin(845) 3 years, 10 months ago

I've seen many developers actually using and abusing SELECT * FROM queries. SELECT * query not only returns unnecessary data, but it also can force clustered index scans for query plans because columns in the SELECT clause are also considered by the optimizer when it identifies indexes for execution plans.

1 comment |category: |Views: 370

tags: another

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:
Comments:

posted by spirit1spirit1(3160) 3 years, 10 months ago 0

as good as this advice is the first execution plan has nothing to do with the * itself.
It is showing a bookmark lookup that will happen for every query when you're filtering on a column that has a non clustered index and
columns in the select list that are not covered by a non clustered index.
because data is stored in the leaf level of the CI a bookmark look up is looking up that data in the CI.

just to clear thing up :))

other than that the advice is sound!

Reply

information Login or create an account to comment on this story