Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing column Length makes queries slower

Status
Not open for further replies.

GJParker

Programmer
Jul 4, 2002
1,614
GB
After changing the Length of a column from char 30 to char 10 my select queries are running considerably slower.

The column is indexed so i tried deleting and recreating the index this had no effect. I have also tried an INDEXDEFRAG, again to no effect.

Please HELP !!!! Gary Parker
Systems Support Analyst
 
Just a thought, but I have no idea if this is true:

is the server still building the index? If so, you're essentially scanning a non-indexed.
 
I'm quite sure the indexing has finished on the server.

by considerably slower I mean that a query that took @1 second now takes 3 seconds (this i can live with) and a query that tok @1 minute now takes @ 30 minutes.

HELP Gary Parker
Systems Support Analyst
 
If you change the column length back to 30 char do your queries run at their original speed?

If not I would suggest the change in column length is not the cause of your problem.

Can you post a bit more information about the sturcture of your table and indexes, and the type o queries you're running?

Nathan

 
Does the query include JOINs? If so, are the JOINs on the column that was changed? Have you examined the estimated query execution plan to see where the highest cost of the query is? Is SQL Server even using the index on the changed column? If you want to get the best answer for your question read faq183-874 and faq183-3179.
Terry L. Broadbent - DBA
SQL Server Page:
 
Hi,

I'm sure this is simple to do but...
I want to concatenate a list of variables which are then written to another field and display them in neat columns.

I've used the tab character below but if one field is too long it shifts all other fields to the right.

set @Ticket_Details = @Ticket_Details + @Ticket_No + char
(9) + @Status + char(9) + @Logged_Date

Is there a way to ensure the fields will always be lined up.

Thanks

Phil

 
Phil,
You should really start a new post for your question as it has nothing to do with this thread. This will ensure people do not skip over it when looking through the list.

--James
 
Why on earth would you want to do this? Rule one of database design, never store more than 1 piece of information in a field. If each variable is in it's own field then they are nicely lined up anyway when you run the select statement. James is right though, you should put this in it's own topic.
 
It was a mistake, i never meant for the post to be added to this topic.

I am storing multiple information in one field because the field with the combined data is the picked up by a process and distributed in an email. And no, I don't want to pass all the seperate fields to the email process.



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top