-
Notifications
You must be signed in to change notification settings - Fork 3
Write tests for a nullable index on shard #43
Comments
We should support filtering features capacity like SQL does. For plain selects (w/o connections): IS NULL / IS NOT NULL. I think it must be implemented via future 'filter' argument (added to and tracked by #13). For 1:1 connections we should choose one of MATCH SIMPLE / MATCH PARTIAL / MATCH FULL behaviour (from SQL, part of the REFERENCES clause). The same / an another behaviour should be choosen for 1:N connections. MATCH behaviourr in terms of connections:
My proposal is to use MATCH FULL behaviour (because it is the most strict one) for both 1:1 and 1:N connections at least before we’ll find real cases where less strict constraints are helpful. Offset is always by a primary index (UNIQUE and NOT NULL), so it is non-sense to pass null as a part of such key. As result offset parts must be non-null. (It is validated by comparing parts count.) Before going to test cases we should split the problem into the two parts.
Note: the connection underlying index (within the destination collection) can be nullable or not, it does not matter. But within the MATCH FULL logic we cannot fetch by the connection those destinations objects have nulls in the corresponding fields (because we either don’t have not nulls in the key or don’t fetch the destination collection objects). I think we should not ban such kind of indexes, because the indexes can be reused for other reasons.
There are three cases that can lead to use an index: a) fetching top-level objects by a list of non-null values (we should make sure that null cannot be passed explicitly, though); The question is: Q) Can we pass a key with nullable parts explicitly or implicitly (via a connection)? The answer is 'no' (at least until we’ll add support for IS NULL / IS NOT NULL). The fullscan case and GT iterator case does not matter, because we do fullscan only by a primary key. So, we should check that nullable indexes works as expected with a non-null key for EQ iterators (don’t show nulls in the corresponding fields). The indexes to check are: compound secondary unique/non-unique matching with a key as full/partial with at least one nullable part; the data should contain at least two objects with nulls in the field corresponding the nullable index part. Cases to test nullable indexes on spaces and shard (and compare results):
|
We should correctly handle nullable index with partial/full keys. Cases TBD.
The text was updated successfully, but these errors were encountered: