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 2000 Forums
 SQL Server Development (2000)
 varchar(500) vs text

Author  Topic 

mike123
Master Smack Fu Yak Hacker

1462 Posts

Posted - 2003-04-24 : 05:28:17

I have a table in my web application as follows.

MessageID (INT)
MessageFromID (INT)
MessageToID (INT)
Message (VARCHAR(500))
Date (SMALLDATETIME)

When users are logged in, the table is scanned for unchecked messages for the user, so it is quite a heavy load.

My question is would the Message Column be better of as a TEXT datatype rather than varchar 500? I do not really know much about the text field, but I do know that I use them in forums. Would converting to text possibly increase speed?

There are usually about 50,000-75,000 rows in the table, depending on the time of day. I am guessing about 75,000 messages are sent daily. I do not really know what other information to offer, but I will gladly answer any specific questions.


Thanks for the help

Mike123

Peter Dutch
Posting Yak Master

127 Posts

Posted - 2003-04-24 : 05:31:17
If you don't need to convert to TEXT don't.

(you need to convert to TEXT if you need more than 8000 chars in a field)

In your situation, don't convert to TEXT.


Go to Top of Page

mike123
Master Smack Fu Yak Hacker

1462 Posts

Posted - 2003-04-24 : 06:28:55

is there any issue at hand with indexing ?

Go to Top of Page

Andraax
Aged Yak Warrior

790 Posts

Posted - 2003-04-24 : 06:51:10
Yeah. You can't put a normal index on a text column. However you can use full-text indexing.

Go to Top of Page
   

- Advertisement -