开发者

SQL Server Indexed view for Full Text Search

I want to use the Ful开发者_C百科l Text Search feature of Microsoft SQL Server.

If I have a table Client which refers other tables like City, Country, Department, etc. is it better to create a separate table that would hold de-normalized data, which would then be full text indexed, or is it better to create a dummy value in every foreign table (for instance with key -1 ) and then substitute the NULLs from the Client table with those corresponding dummy values, then create an indexed view (those dummy entries are because of the indexed view and the use of 'inner join' instead of 'left join') and then create a full text index on this index view?

With the latter I wouldn't have to worry about populating the 'de-normalized' table every time a record changes in the Client, or in any of the foreign tables - City, Country, Department, etc.

Or maybe none of the above, I could use some new ideas as well :)


None of the above.

Keep the data normalized and create separate FT indexes on each normalized table. When querying the data, query the relevant table. If you want a query to span multiple tables (eg. if either City, Country or Department contain 'York') then use normal query UNION operators to aggregate searches across multiple tables. This is how FT works, so keep your design aligned with the way the feature works. Don't try to cheat, you're only going to burn yourself.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜