Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 2005
»
SQL Server 2005 Performance Tuning
»
Is it possible to create nonclustered index...
11 posts, Page 1 of 2
1
2
»»
Is it possible to create nonclustered index on columns with space and ignore the space so that it does not do a table scan?
Rate Topic
Display Mode
Topic Options
Author
Message
skhan-680833
skhan-680833
Posted Friday, December 18, 2009 10:02 AM
Grasshopper
Group: General Forum Members
Last Login: Thursday, August 12, 2010 10:47 AM
Points: 24,
Visits: 58
Is it possible to create nonclustered index on columns with space and ignore the space so that it does not do a table scan?
Thank You
SD Khan
Post #836456
SQLRNNR
SQLRNNR
Posted Friday, December 18, 2009 10:16 AM
SSCoach
Group: General Forum Members
Last Login: 2 days ago @ 1:07 PM
Points: 18,733,
Visits: 12,332
The table scan occurs if the Engine determines that a table scan will be more efficient. If you have null values or empty strings in your column, they will be included in your non-clustered index if you create it.
You should test the creation of your non-clustered index to determine if the new index will help improve performance. One of the factors to consider is column selectivity and uniqueness of the data in that column. The query that is causing the table-scan may also need to be revised.
Jason
AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server 2008
SQL RNNR
Posting Performance Based Questions - Gail Shaw
Posting Data Etiquette - Jeff Moden
Hidden RBAR - Jeff Moden
VLFs and the Tran Log - Kimberly Tripp
Post #836467
GilaMonster
GilaMonster
Posted Friday, December 18, 2009 10:25 AM
SSC-Dedicated
Group: General Forum Members
Last Login: Today @ 4:49 PM
Points: 37,722,
Visits: 29,977
What precisely do you mean by "columns with space"?
Columns with lots of nulls?
Columns with lots of empty strings?
Columns that have varchar/nvarchar with leading/trailing spaces?
Something else?
Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild
: Discussions on DB performance with occasional diversions into recoverability
We walk in the dark places no others will enter
We stand on the bridge and no one may pass
Post #836479
skhan-680833
skhan-680833
Posted Friday, December 18, 2009 10:31 AM
Grasshopper
Group: General Forum Members
Last Login: Thursday, August 12, 2010 10:47 AM
Points: 24,
Visits: 58
I am not sure what the developer is actually trying to achive so i told him to redo his query.....but is it possible to do teh create index in a way so that it ignores the blank spaces?
I think the problem is there has been new fields added and new data is coming in in the table.
Thank you
Post #836485
John Rowan
John Rowan
Posted Friday, December 18, 2009 10:35 AM
Hall of Fame
Group: General Forum Members
Last Login: Tuesday, January 29, 2013 10:54 AM
Points: 3,837,
Visits: 3,821
Who designed the tables, the developer? If you post the table DDL, index definitions, sample data and your query, we can help more. Please reference this link to learn how to format your sample content:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
John Rowan
======================================================
======================================================
Forum Etiquette: How to post data/code on a forum to get the best help
- by Jeff Moden
Post #836490
GilaMonster
GilaMonster
Posted Friday, December 18, 2009 10:52 AM
SSC-Dedicated
Group: General Forum Members
Last Login: Today @ 4:49 PM
Points: 37,722,
Visits: 29,977
skhan-680833 (12/18/2009)
but is it possible to do teh create index in a way so that it ignores the blank spaces?
What do you mean? What blank spaces where?
Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild
: Discussions on DB performance with occasional diversions into recoverability
We walk in the dark places no others will enter
We stand on the bridge and no one may pass
Post #836500
Lynn Pettis
Lynn Pettis
Posted Friday, December 18, 2009 10:54 AM
SSC-Insane
Group: General Forum Members
Last Login: Today @ 11:17 PM
Points: 21,617,
Visits: 27,450
GilaMonster (12/18/2009)
skhan-680833 (12/18/2009)
but is it possible to do teh create index in a way so that it ignores the blank spaces?
What do you mean? What blank spaces where?
Almost sounds like a filtered index. Unfortunately, not available in SQL Server 2005.
Lynn Pettis
For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here
or
when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here
and
here
Managing Transaction Logs
SQL Musings from the Desert
Fountain Valley SQL
(My Mirror Blog)
Post #836502
SQLRNNR
SQLRNNR
Posted Friday, December 18, 2009 11:59 AM
SSCoach
Group: General Forum Members
Last Login: 2 days ago @ 1:07 PM
Points: 18,733,
Visits: 12,332
More information would be needed to best answer the question. As it is, we are only guessing at how best to help/answer your question.
Jason
AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server 2008
SQL RNNR
Posting Performance Based Questions - Gail Shaw
Posting Data Etiquette - Jeff Moden
Hidden RBAR - Jeff Moden
VLFs and the Tran Log - Kimberly Tripp
Post #836553
skhan-680833
skhan-680833
Posted Friday, December 18, 2009 12:05 PM
Grasshopper
Group: General Forum Members
Last Login: Thursday, August 12, 2010 10:47 AM
Points: 24,
Visits: 58
Thanks everyone. I have asked the developer to redo the query. I do not think filtered index is an option and as it is a vendor apps they build these indexes thourgh the vendor designer tools. Also I checked a few things and I think he should not put indexes on those columns and do the query in a different way. Thank you for all of your help and suggestions.
SD Khan
Post #836560
SQLRNNR
SQLRNNR
Posted Friday, December 18, 2009 12:57 PM
SSCoach
Group: General Forum Members
Last Login: 2 days ago @ 1:07 PM
Points: 18,733,
Visits: 12,332
You're welcome.
Jason
AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server 2008
SQL RNNR
Posting Performance Based Questions - Gail Shaw
Posting Data Etiquette - Jeff Moden
Hidden RBAR - Jeff Moden
VLFs and the Tran Log - Kimberly Tripp
Post #836599
« Prev Topic
|
Next Topic »
11 posts, Page 1 of 2
1
2
»»
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.