In our product definition we have multiple fields with [BackingType(typeof(PropertyString))] This type of string has a max length of 255
When we look up the value in the database, it is stored in the LongString nvarchar(max) field in the CatalogContentProperty table.I would expect it to be in the String nvarchar(450) column in this table.
Is it possible to change the behaviour so that short strings will be stored in the String column?
Currently there is no way to do that. However I think this might be a mistake in our side, I'll check with my colleagues about this.
It was unclear to me why it was LongString instead of String, but our best guess was we followed the design in CMS content system. With newer versions of SQL Server (2005+ I think), the performance of NVARCHAR(450) and NVARCHAR(MAX) with 450 characters are comparable (the difference, if any, is very insignificant)
So I don't think you have to worry about performance. Is there any other reason for your concern?
For our solution we created a field for the Brand of a product. We read the Brands from the database, and later all products of that Brand.
For performance improvement we wanted to put an index on the column, but because it is a nvarchar(max) column this is not possible.
If you want to get a product in a brand, I would suggest you to use the SearchProvider APIs - it's faster and more scalable than querying SQL directly.