Hi Ben, If the below idea of allowing NULL values for Indexed columns makes sense., shall we add an attribute (allow_null_index = false kind) as an optional parameter for such type of columns and ensure compatibility with existing/old schema? Does it sound okay?
Thanks Krishna Mohan -----Original Message----- From: Ben Pfaff [mailto:b...@ovn.org] Sent: Monday, April 11, 2016 11:00 AM To: Ansari, Shad <shad.ans...@hpe.com> Cc: Elluru, Krishna Mohan <elluru.kri.mo...@hpe.com>; dev@openvswitch.org Subject: Re: [ovs-dev] [PATCH] ovsdb: Force columns that contain weak references to be immutable. On Mon, Apr 04, 2016 at 10:38:40PM +0000, Ansari, Shad wrote: > > > > HI Ben, > > How does column which is weak reference and also configured as an > > Index? If it is mutable, and the corresponding UUID going > > away(deletion of record) leaves column value as NULL right? And what > > would be the behavior if the table is a Root table also? > > I am listing down, my assumptions: > > > > 1. In table X, If the column is index and a weak reference to table > > y, on table y row deletion, the index field would become NULL and > > since it is an index, constraint violation would occur and to avoid, > > it is expected to remove the row first in table X and table Y row > > deletion can happen in same txn or consequent transactions. Correct? > > 2. If the table X is also a root table, and one of its column is an > > index and weak reference to table Y, on row deletion in table Y, > > constraint violation would occur, hence similar to above table X row > > cleanup is expected to happen prior to table Y row deletion. > > > > If above 2 statements is true, index with weak reference is > > becoming equivalent to strong reference. Am I correct? > > > > Thanks > > Krishna Mohan > > Would it make sense to allow NULL values for columns that are references and > indexes. Something like what MySQL allows for unique keys. > > http://dev.mysql.com/doc/refman/5.0/en/create-index.html That's a reasonable idea. It could theoretically break some currently working use cases, if someone has an OVSDB schema that relies on an index to ensure the uniqueness of an empty column. I don't know whether there are schemas out there that rely on this property. I don't know how this idea would extend to multi-column indexes. _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev