> Le 4 févr. 2017 à 21:23, Jeffrey Kain <[email protected]> a écrit :
> 
> In older versions of 4D it was possible to create a field with 'unique' but 
> not indexed. This causes 4D to have to do full table scans for every 
> insert/update in order to validate uniqueness. In a large table, this is a 
> huge performance problem. Clearly a competent developer who understands the 
> basics of how databases work would never do this on a large, frequently 
> updated table, but 4D still let you fall into that trap.

Hi Jeffrey, 
that was not my question, I understand the performance problem and that 4D has 
to index a field to ensure it's unique with decent speed (although in small 
tables it seems a bit excessive). 

Reading indexes in system tables I was surprised first to find 2 UNIQUENESS 
columns, in field and index. Thinking better, I guess field.unique is just a 
kind of trigger to create an index.unique. 

Then I said myself "well, if the index has a uniqueness column, I should be 
able to set that somewhere". But uniqueness is missing in the create index 
dialog. It seems index.unique can only be inherited form field.unique or from a 
primary key definition. 

-- 
Arnaud de Montard 



**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to