Skip to content

[2pt] new option "exclude_null=true/false" #1782

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
TarantoolBot opened this issue Jan 27, 2021 · 2 comments · Fixed by #2033
Closed

[2pt] new option "exclude_null=true/false" #1782

TarantoolBot opened this issue Jan 27, 2021 · 2 comments · Fixed by #2033
Assignees
Labels
feature A new functionality reference [location] Tarantool manual, Reference part

Comments

@TarantoolBot
Copy link
Collaborator

TarantoolBot commented Jan 27, 2021

Added new option for index part definition,
that allows index to skip tuples with null at this part.
By default the option is turned off.
When turned on, "is_nullable=true" option will be set automatically.
It can't be turned on for the primary key.
Option can be changed dynamically (in this case index is rebuilt).
Such index does not store filtered tuples at all,
so indexing can be done faster.
SQL: such index is skipped in select statements
unless explicitly specified.

exclude_null and is_nullable are connected, so
this table describes the result of combining them.

Exclude NULL/Nullable False True
False + +
True - * + **

* is not allowed
** Partial index
Requested by @mary3000 in tarantool/tarantool@17c9c03.

@Onvember Onvember added feature A new functionality reference [location] Tarantool manual, Reference part S (small) labels Jan 29, 2021
@Onvember Onvember changed the title new option "exclude_null=true/false" [6pt] new option "exclude_null=true/false" Feb 12, 2021
@NickVolynkin NickVolynkin changed the title [6pt] new option "exclude_null=true/false" [2pt] new option "exclude_null=true/false" Mar 10, 2021
Onvember added a commit that referenced this issue Apr 6, 2021
@Onvember
Copy link
Contributor

Onvember commented Apr 7, 2021

SQL: such index is skipped in select statements unless explicitly specified.

@pgulutzan we have here a note for SQL. Where should we write it on our doc?

@pgulutzan
Copy link
Contributor

@Onvember:

https://www.tarantool.io/en/doc/latest/reference/reference_sql/sql_statements_and_clauses/#indexed-by-clause
i.e. ./reference/reference_sql/sql_statements_and_clauses.rst
after the words "Ordinarily Tarantool chooses the appropriate index or lookup method depending on a complex set of “optimizer” rules; the INDEXED BY clause overrides the optimizer choice."
The new feature could be ignored with the reasoning that we never claim what index will be chosen anyway, but I think it would be okay to add
"If the index was defined with the is_nullable parts option, it will only be used if the user specifies it."

Incidentally I notice that according to tarantool/tarantool#4480 this is milestone 2.8.2.

Onvember added a commit that referenced this issue Apr 9, 2021
* update headings and indentation according to documentation style guidelines

* fixes gh-1782 describe exclude_null option

* add note for SQL reference
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new functionality reference [location] Tarantool manual, Reference part
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants