Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sql: stop producing inv idx keys for NULL
Previously, an inverted index on a JSON column would contain an index entry for every row that had a SQL NULL value in the JSON column, despite the the fact that the query planner does not use inverted indexes to satisfy an IS NULL predicate. This commit changes the behavior of inverted indexing to cease producing these index keys. As a sidebar, Postgres also does not include NULL values in its inverted indexes, nor does Elastic, so I don't think this behavior goes against user expectation. In addition, the optimizer already did not use the index for IS NULL predicates, so there will be no behavior changes for users of inverted indexes. This change has a side effect of orphaning any entries for NULL datums that might already exist in an inverted index. These will not be cleaned up, even if a particular row is updated to not contain NULL, until the index is dropped or truncated. This problem is rare, and could only conceivably be problematic for tables with many NULL values in a column that's indexed with an inverted index, a very unusual case. Release note: None
- Loading branch information