dbTalk Databases Forums  

Searching in a column

microsoft.public.sqlserver.tools microsoft.public.sqlserver.tools


Discuss Searching in a column in the microsoft.public.sqlserver.tools forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Geert
 
Posts: n/a

Default Searching in a column - 05-14-2008 , 03:39 AM






Hi,

I have a table with more then 500000 records.
I'm trying to search for a part of word in a description-column (char50),
normally I take the like statement. But sometimes it is too slow.

Does anyone have a solution for that ?
Using full text search is not an option.

Thx
Geert

Reply With Quote
  #2  
Old   
Aaron Bertrand [SQL Server MVP]
 
Posts: n/a

Default Re: Searching in a column - 05-14-2008 , 10:01 AM






Quote:
I have a table with more then 500000 records.
I'm trying to search for a part of word in a description-column (char50),
Did you mean varchar(50)? If it is really char(50), are they really mostly
50 characters? If not, you may see some minor improvements if you switch to
varchar.

Quote:
Does anyone have a solution for that ?
Store the data better? If individual words are important then maybe you
could consider a relational table with the individual words where you can
search with equality instead of wildcards. This is similar to the "tagging"
concept where you can tag a row with 1-n tag words, and they are stored
separately so it is more efficient to search for them (using an index) as
opposed to parsing a delimited list.

Quote:
Using full text search is not an option.
Why? This is exactly what it's for. And since FTS is even available in SQL
Express w/advanced services, can you explain why it is not an option?



Reply With Quote
  #3  
Old   
Aaron Bertrand [SQL Server MVP]
 
Posts: n/a

Default Re: Searching in a column - 05-14-2008 , 10:01 AM



Quote:
I have a table with more then 500000 records.
I'm trying to search for a part of word in a description-column (char50),
Did you mean varchar(50)? If it is really char(50), are they really mostly
50 characters? If not, you may see some minor improvements if you switch to
varchar.

Quote:
Does anyone have a solution for that ?
Store the data better? If individual words are important then maybe you
could consider a relational table with the individual words where you can
search with equality instead of wildcards. This is similar to the "tagging"
concept where you can tag a row with 1-n tag words, and they are stored
separately so it is more efficient to search for them (using an index) as
opposed to parsing a delimited list.

Quote:
Using full text search is not an option.
Why? This is exactly what it's for. And since FTS is even available in SQL
Express w/advanced services, can you explain why it is not an option?



Reply With Quote
  #4  
Old   
Aaron Bertrand [SQL Server MVP]
 
Posts: n/a

Default Re: Searching in a column - 05-14-2008 , 10:01 AM



Quote:
I have a table with more then 500000 records.
I'm trying to search for a part of word in a description-column (char50),
Did you mean varchar(50)? If it is really char(50), are they really mostly
50 characters? If not, you may see some minor improvements if you switch to
varchar.

Quote:
Does anyone have a solution for that ?
Store the data better? If individual words are important then maybe you
could consider a relational table with the individual words where you can
search with equality instead of wildcards. This is similar to the "tagging"
concept where you can tag a row with 1-n tag words, and they are stored
separately so it is more efficient to search for them (using an index) as
opposed to parsing a delimited list.

Quote:
Using full text search is not an option.
Why? This is exactly what it's for. And since FTS is even available in SQL
Express w/advanced services, can you explain why it is not an option?



Reply With Quote
  #5  
Old   
Aaron Bertrand [SQL Server MVP]
 
Posts: n/a

Default Re: Searching in a column - 05-14-2008 , 10:01 AM



Quote:
I have a table with more then 500000 records.
I'm trying to search for a part of word in a description-column (char50),
Did you mean varchar(50)? If it is really char(50), are they really mostly
50 characters? If not, you may see some minor improvements if you switch to
varchar.

Quote:
Does anyone have a solution for that ?
Store the data better? If individual words are important then maybe you
could consider a relational table with the individual words where you can
search with equality instead of wildcards. This is similar to the "tagging"
concept where you can tag a row with 1-n tag words, and they are stored
separately so it is more efficient to search for them (using an index) as
opposed to parsing a delimited list.

Quote:
Using full text search is not an option.
Why? This is exactly what it's for. And since FTS is even available in SQL
Express w/advanced services, can you explain why it is not an option?



Reply With Quote
  #6  
Old   
Aaron Bertrand [SQL Server MVP]
 
Posts: n/a

Default Re: Searching in a column - 05-14-2008 , 10:01 AM



Quote:
I have a table with more then 500000 records.
I'm trying to search for a part of word in a description-column (char50),
Did you mean varchar(50)? If it is really char(50), are they really mostly
50 characters? If not, you may see some minor improvements if you switch to
varchar.

Quote:
Does anyone have a solution for that ?
Store the data better? If individual words are important then maybe you
could consider a relational table with the individual words where you can
search with equality instead of wildcards. This is similar to the "tagging"
concept where you can tag a row with 1-n tag words, and they are stored
separately so it is more efficient to search for them (using an index) as
opposed to parsing a delimited list.

Quote:
Using full text search is not an option.
Why? This is exactly what it's for. And since FTS is even available in SQL
Express w/advanced services, can you explain why it is not an option?



Reply With Quote
  #7  
Old   
Aaron Bertrand [SQL Server MVP]
 
Posts: n/a

Default Re: Searching in a column - 05-14-2008 , 10:01 AM



Quote:
I have a table with more then 500000 records.
I'm trying to search for a part of word in a description-column (char50),
Did you mean varchar(50)? If it is really char(50), are they really mostly
50 characters? If not, you may see some minor improvements if you switch to
varchar.

Quote:
Does anyone have a solution for that ?
Store the data better? If individual words are important then maybe you
could consider a relational table with the individual words where you can
search with equality instead of wildcards. This is similar to the "tagging"
concept where you can tag a row with 1-n tag words, and they are stored
separately so it is more efficient to search for them (using an index) as
opposed to parsing a delimited list.

Quote:
Using full text search is not an option.
Why? This is exactly what it's for. And since FTS is even available in SQL
Express w/advanced services, can you explain why it is not an option?



Reply With Quote
  #8  
Old   
Aaron Bertrand [SQL Server MVP]
 
Posts: n/a

Default Re: Searching in a column - 05-14-2008 , 10:01 AM



Quote:
I have a table with more then 500000 records.
I'm trying to search for a part of word in a description-column (char50),
Did you mean varchar(50)? If it is really char(50), are they really mostly
50 characters? If not, you may see some minor improvements if you switch to
varchar.

Quote:
Does anyone have a solution for that ?
Store the data better? If individual words are important then maybe you
could consider a relational table with the individual words where you can
search with equality instead of wildcards. This is similar to the "tagging"
concept where you can tag a row with 1-n tag words, and they are stored
separately so it is more efficient to search for them (using an index) as
opposed to parsing a delimited list.

Quote:
Using full text search is not an option.
Why? This is exactly what it's for. And since FTS is even available in SQL
Express w/advanced services, can you explain why it is not an option?



Reply With Quote
  #9  
Old   
Aaron Bertrand [SQL Server MVP]
 
Posts: n/a

Default Re: Searching in a column - 05-14-2008 , 10:01 AM



Quote:
I have a table with more then 500000 records.
I'm trying to search for a part of word in a description-column (char50),
Did you mean varchar(50)? If it is really char(50), are they really mostly
50 characters? If not, you may see some minor improvements if you switch to
varchar.

Quote:
Does anyone have a solution for that ?
Store the data better? If individual words are important then maybe you
could consider a relational table with the individual words where you can
search with equality instead of wildcards. This is similar to the "tagging"
concept where you can tag a row with 1-n tag words, and they are stored
separately so it is more efficient to search for them (using an index) as
opposed to parsing a delimited list.

Quote:
Using full text search is not an option.
Why? This is exactly what it's for. And since FTS is even available in SQL
Express w/advanced services, can you explain why it is not an option?



Reply With Quote
  #10  
Old   
Aaron Bertrand [SQL Server MVP]
 
Posts: n/a

Default Re: Searching in a column - 05-14-2008 , 10:01 AM



Quote:
I have a table with more then 500000 records.
I'm trying to search for a part of word in a description-column (char50),
Did you mean varchar(50)? If it is really char(50), are they really mostly
50 characters? If not, you may see some minor improvements if you switch to
varchar.

Quote:
Does anyone have a solution for that ?
Store the data better? If individual words are important then maybe you
could consider a relational table with the individual words where you can
search with equality instead of wildcards. This is similar to the "tagging"
concept where you can tag a row with 1-n tag words, and they are stored
separately so it is more efficient to search for them (using an index) as
opposed to parsing a delimited list.

Quote:
Using full text search is not an option.
Why? This is exactly what it's for. And since FTS is even available in SQL
Express w/advanced services, can you explain why it is not an option?



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.