views:

21

answers:

1

I want to use the Full 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 :)

+2  A: 

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.

Remus Rusanu