[Cubicweb] unique constraint on unlimited String attribute

Florent Cayré florent.cayre at logilab.fr
Fri Jun 17 12:08:08 CEST 2016

On 06/16/16 15:03, Julien Cristau wrote:
> I guess one option is to have an extra computed column with a (fixed
> size) hash of your nvarchar(max) column, and index *that*, but
> reconsidering either the index or the lack of size limit might be
> better.

Agreed for search (indexed=True in yams), not for uniqueness
(unique=True in yams).

This suggestion would also make it possible to handle cwuri's example
properly (using a limited-in-length but reversed string for the indexed
column for instance). There should be litterature around for this topic.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.cubicweb.org/pipermail/cubicweb/attachments/20160617/5812e904/attachment-0273.sig>

More information about the Cubicweb mailing list