add a flag to indicate if a vindex handles null value#6425
add a flag to indicate if a vindex handles null value#6425sougou merged 3 commits intovitessio:masterfrom
Conversation
Signed-off-by: Chen Ding <chen.ding@airbnb.com>
|
We already have function which does similar check directly use |
|
thanks for pointing out! do you have a printer about the |
|
Inserting null value into lookup does not give any value. You can update your code to use NeedVCursor |
|
yes, this is not about inserting null value into lookup table, it is about query like |
|
oh, i see your comment, yes, i could change to use |
|
updated to use |
Signed-off-by: Chen Ding <chen.ding@airbnb.com>
|
I recently added support for "ignore_nulls" as an option for lookups here #6222. Will it be better if we just returned the full keyrange from the lookup vindex if this flag was set? The other question is: did you want this for a unique or non-unique lookup? One risk about a unique lookup is that there are places where we assume that no more than one shard will be a target. So, I'm concerned about how that interpretation may play out with a change like this. Having said that, there is one rare (and intended) situation where a unique lookup does return more than one shard: https://github.com/vitessio/vitess/blob/master/go/vt/vtgate/vindexes/lookup.go#L227-L232. But the use case is acceptable because it happens while a lookup is being back-filled. In other words, will it be ok if we changed this where a non-unique lookup returned a full scatter if input was |
Signed-off-by: Chen Ding <chen.ding@airbnb.com>
there is a recent change to improve
is nullquery #6133, it changed the behavior from always to fallback to scatter gather for null query, to treat null as an value and handle it in vindex.however, not all vindexes could handle null value, especially, the lookup table based vindex doesn't store null value at all, so add a new flag to indicate if the vindex could handle null and fallback to scatter gather for null query if the vindex doesn't support it.