Skip to content
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

Replace sqlite 32 column mask with our smart 64 bit one #3571

Closed
Gerold103 opened this issue Jul 26, 2018 · 0 comments
Closed

Replace sqlite 32 column mask with our smart 64 bit one #3571

Gerold103 opened this issue Jul 26, 2018 · 0 comments
Assignees
Labels
good first issue Good for newcomers refactoring Code refactoring sql
Milestone

Comments

@Gerold103
Copy link
Collaborator

Column mask in Tarantool is not just 32 bits greater, but also it is smarter. When a column with number > 63 is added to the mask, the only last bit (64th) is set indicating the overflow. SQLite mask in such a case just resets the whole mask in -1.

Lets replace sqlite column mask with our one in all places.

@Gerold103 Gerold103 added refactoring Code refactoring sql good first issue Good for newcomers labels Jul 26, 2018
@kyukhin kyukhin added this to the 2.1.1 milestone Jul 30, 2018
kshcherbatov added a commit that referenced this issue Aug 30, 2018
Refactored SQL Bitmask with tarantool core uint64_t column mask
and API functions.

Closes #3571.
@kyukhin kyukhin modified the milestones: 2.1.1, 2.2.0 Nov 26, 2018
kshcherbatov added a commit that referenced this issue Feb 8, 2019
Refactored column_mask.h definitions: introduced a new routine
column_mask_is_overflowed, column_mask_is_set and macro
COLUMN_MASK_BIT, COLUMN_MASK_SIZE.
We need this helpers in further refactoring.

Needed for #3571
kshcherbatov added a commit that referenced this issue Feb 8, 2019
In some cases(like foreign keys) the SQL code is still used
32-bit bit mask, while 64-bit bit masks will perform better
column optimizations. There was refactored code to work with 64b
bitmasks where required.
The 32b bitmasks are still used to specify constant OP_Function
arguments because this change would require changing the P1 type
of the VDBE p1 argument, which is not desirable. Moreover, the
64 function's arguments is an explicit overkill.

Part of #3571
kshcherbatov added a commit that referenced this issue Feb 8, 2019
MASK BIT 32 macro is now redundant, so we got rid of it.
Also refactored related code to use core bitmasks helpers

Part of #3571
kshcherbatov added a commit that referenced this issue Feb 8, 2019
The original SQLite code allowed the program to be compiled using
32-bit masks to save disk space. Since we are not going to
compile Tarantool in such way, we will get rid of these macros by
replacing them(where possible) with helpers from column_mask.h

Closes #3571
kshcherbatov added a commit that referenced this issue Feb 20, 2019
Refactored column_mask.h definitions: introduced a new routine
column_mask_is_overflowed, column_mask_is_set and macro
COLUMN_MASK_BIT, COLUMN_MASK_SIZE.
We need this helpers in further refactoring.

Needed for #3571
kshcherbatov added a commit that referenced this issue Feb 20, 2019
In some cases(like foreign keys) the SQL code is still used
32-bit bit mask, while 64-bit bit masks will perform better
column optimizations. There was refactored code to work with 64b
bitmasks where required.
The 32b bitmasks are still used to specify constant OP_Function
arguments because this change would require changing the P1 type
of the VDBE p1 argument, which is not desirable. Moreover, the
64 function's arguments is an explicit overkill.

Part of #3571
kshcherbatov added a commit that referenced this issue Feb 20, 2019
MASK BIT 32 macro is now redundant, so we got rid of it.
Also refactored related code to use core bitmasks helpers

Part of #3571
kshcherbatov added a commit that referenced this issue Feb 20, 2019
The original SQLite code allowed the program to be compiled using
32-bit masks to save disk space. Since we are not going to
compile Tarantool in such way, we will get rid of these macros by
replacing them(where possible) with helpers from column_mask.h

Closes #3571
kshcherbatov added a commit that referenced this issue Feb 20, 2019
Refactored column_mask.h definitions: introduced a new routine
column_mask_is_overflowed, column_mask_is_set. Also a couple of
routines for 32-bit bitmask.
We need this helpers in further refactoring.

Needed for #3571
kshcherbatov added a commit that referenced this issue Feb 20, 2019
In some cases(like foreign keys) the SQL code is still used
32-bit bit mask, while 64-bit bit masks will perform better
column optimizations. There was refactored code to work with 64b
bitmasks where required.
The 32b bitmasks are still used to specify constant OP_Function
arguments because this change would require changing the P1 type
of the VDBE p1 argument, which is not desirable. Moreover, the
64 function's arguments is an explicit overkill.

Part of #3571
kshcherbatov added a commit that referenced this issue Feb 20, 2019
MASK BIT 32 macro is now redundant, so we got rid of it.
Also refactored related code to use core bitmasks helpers

Part of #3571
kshcherbatov added a commit that referenced this issue Feb 20, 2019
The original SQLite code allowed the program to be compiled using
32-bit masks to save disk space. Since we are not going to
compile Tarantool in such way, we will get rid of these macros by
replacing them(where possible) with helpers from column_mask.h

Closes #3571
kshcherbatov added a commit that referenced this issue Mar 20, 2019
In some cases(like foreign keys) the SQL code used
32-bit bit mask, while 64-bit bit masks will perform better
column optimizations. There was refactored code to work with 64b
bitmasks where required.
The 32b bitmasks are still used to specify constant OP_Function
arguments because this change would require changing the P1 type
of the VDBE p1 argument, which is not desirable. Moreover, the
64 function's arguments is an explicit overkill.

The ticket was created in connection with the introduction of
foreign keys and their use of 32-bit bit masks. In the rest of
the scripts in SQL already use 64 bit masks, and the "smart" bit
of the mask is not applicable.

Closes #3571
kshcherbatov added a commit that referenced this issue Mar 27, 2019
In some cases(like foreign keys) the SQL code used
32-bit bit mask, while 64-bit bit masks will perform better
column optimizations. There was refactored code to work with 64b
bitmasks where required.
The 32b bitmasks are still used to specify constant OP_Function
arguments because this change would require changing the P1 type
of the VDBE p1 argument, which is not desirable. Moreover, the
64 function's arguments is an explicit overkill.

The ticket was created in connection with the introduction of
foreign keys and their use of 32-bit bit masks. In the rest of
the scripts in SQL already use 64 bit masks, and the "smart" bit
of the mask is not applicable.

Closes #3571
@kyukhin kyukhin added the tmp label Aug 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers refactoring Code refactoring sql
Projects
None yet
Development

No branches or pull requests

4 participants