Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Index

Author  Topic 

sqlfresher2k7
Aged Yak Warrior

623 Posts

Posted - 2012-02-15 : 14:21:30
Can i create an index on the varchar column with the data like below with having 10 millions records the performance is very slow..

As it has like operators to delete the records..

Colname
--------
01/12/12 11:26:04;Num_Categpru;Start;1

Please advise.

Thanks for you help in advance..

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2012-02-15 : 14:23:04
You can create an index, whether it will be of any use however is another matter...

May I suggest normalisation?

--
Gail Shaw
SQL Server MVP
Go to Top of Page

sqlfresher2k7
Aged Yak Warrior

623 Posts

Posted - 2012-02-15 : 14:37:01
if we create an index would be any improve performance..

Can you please elaborate on your suggestion what exactly i had to normalise..
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2012-02-15 : 14:40:41
INSERTS Slow down, SELECTS, UPDATE and DELETEs speed up

What are you trying to do?

And what's the table look like?



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page

sqlfresher2k7
Aged Yak Warrior

623 Posts

Posted - 2012-02-15 : 14:48:31
Table has 2 columns

TableA

Column1 vachar (50)
column2 varchar(50)

Above is the table structure.

I am trying to delete records with where like operators.



Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2012-02-15 : 14:54:21
quote:
Originally posted by sqlfresher2k7

if we create an index would be any improve performance..


If your queries use a SARGable predicate, probably yes

quote:
Can you please elaborate on your suggestion what exactly i had to normalise..


The table. You have a semicolon-delimited list in a field, that's a violation of 1st normal form and an absolute mess when it comes to filtering on subsets of the column or changing subsets of the column.

01/12/12 11:26:04;Num_Categpru;Start;1 should be four columns, not 1. A datetime, a varchar, a second varchar and an int (or smallint)

--
Gail Shaw
SQL Server MVP
Go to Top of Page
   

- Advertisement -