-
Notifications
You must be signed in to change notification settings - Fork 379
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
Move all expression related structs to Tarantool's backend #3235
Comments
F-2-f discussion:
|
Make SQL load schema during initialization. It was initialized on first query before the patch. Replace check that schema is loaded w/ assert arouns the code base. As far as DDL is prohibited inside the transaction, schema cannot be changed inside a transaction and hence, no need to reload it during rollback. No internal changes (SQLITE_InernChanges) are possible. Part of #3235
Let's start from integration of default column attribute into Tarantool core. Proposed changes:
|
Make SQL load schema during initialization. It was initialized on first query before the patch. Replace check that schema is loaded w/ assert arouns the code base. As far as DDL is prohibited inside the transaction, schema cannot be changed inside a transaction and hence, no need to reload it during rollback. No internal changes (SQLITE_InernChanges) are possible. Part of #3235
The main part of this issue is exposing expressions-related parts of parser to Tarantool's core. Need to introduce a flag which will tell to parser, that all is needed is AST, no bytecode should be
This approach should work also for CHECK constraints and maybe partial indexes. |
There is no |
Extract expressions parsing into separate routine to allow Tarantool's backend compile DEFAULT statements w/o SQL machinery at all. So far, for DEFAULT values no context is needed: only constant expressions and built-ins are allowed. In future, table context will be added to allow use column values for CHECK constraint expressions. Move DEFAULT string value to space_def. Move compiled expresion to field_def as well. Reason not to move compiled expression to tuple_field as follows: we do not want to engage parser during tuple validation. So, do it in alter.cc. Closes #3235
Extract expressions parsing into separate routine to allow Tarantool's backend compile DEFAULT statements w/o SQL machinery at all. So far, for DEFAULT values no context is needed: only constant expressions and built-ins are allowed. In future, table context will be added to allow use column values for CHECK constraint expressions. Move DEFAULT string value to space_def. Move compiled expresion to field_def as well. Reason not to move compiled expression to tuple_field as follows: we do not want to engage parser during tuple validation. So, do it in alter.cc. Part of #3235
Extract expressions parsing into separate routine to allow Tarantool's backend compile DEFAULT statements w/o SQL machinery at all. So far, for DEFAULT values no context is needed: only constant expressions and built-ins are allowed. In future, table context will be added to allow use column values for CHECK constraint expressions. Move DEFAULT string value to space_def. Move compiled expresion to field_def as well. Reason not to move compiled expression to tuple_field as follows: we do not want to engage parser during tuple validation. So, do it in alter.cc. In order to allow expression duplication in alter.cc: expose those routines from expr.c and make their names correspond to coding style. Since recovery is performed before SQL fronend initialization: split it into two pieces: 1. create SQL handler, enable all subsystems 2. Do recovery. This will allow to run parser during recovery, since it needs db handle so far. Part of #3235
Extract expressions parsing into separate routine to allow Tarantool's backend compile DEFAULT statements w/o SQL machinery at all. So far, for DEFAULT values no context is needed: only constant expressions and built-ins are allowed. In future, table context will be added to allow use column values for CHECK constraint expressions. Move DEFAULT string value to space_def. Move compiled expresion to field_def as well. Reason not to move compiled expression to tuple_field as follows: we do not want to engage parser during tuple validation. So, do it in alter.cc. In order to allow expression duplication in alter.cc: expose those routines from expr.c and make their names correspond to coding style. Since recovery is performed before SQL fronend initialization: split it into two pieces: 1. create SQL handler, enable all subsystems 2. Do recovery. This will allow to run parser during recovery, since it needs db handle so far. Part of #3235
Extract expressions parsing into separate routine to allow Tarantool's backend compile DEFAULT statements w/o SQL machinery at all. So far, for DEFAULT values no context is needed: only constant expressions and built-ins are allowed. In future, table context will be added to allow use column values for CHECK constraint expressions. Move DEFAULT string value to space_def. Move compiled expresion to field_def as well. Reason not to move compiled expression to tuple_field as follows: we do not want to engage parser during tuple validation. So, do it in alter.cc. In order to allow expression duplication in alter.cc: expose those routines from expr.c and make their names correspond to coding style. Since recovery is performed before SQL fronend initialization: split it into two pieces: 1. create SQL handler, enable all subsystems 2. Do recovery. This will allow to run parser during recovery, since it needs db handle so far. Part of #3235
Extract expressions parsing into separate routine to allow Tarantool's backend compile DEFAULT statements w/o SQL machinery at all. So far, for DEFAULT values no context is needed: only constant expressions and built-ins are allowed. In future, table context will be added to allow use column values for CHECK constraint expressions. Move DEFAULT string value to space_def. Move compiled expresion to field_def as well. Reason not to move compiled expression to tuple_field as follows: we do not want to engage parser during tuple validation. So, do it in alter.cc. In order to allow expression duplication in alter.cc: expose those routines from expr.c and make their names correspond to coding style. Since recovery is performed before SQL fronend initialization: split it into two pieces: 1. create SQL handler, enable all subsystems 2. Do recovery. This will allow to run parser during recovery, since it needs db handle so far. Part of #3235
As far as view materialization routine uses table name only, replace struct Table param w/ (table) name of type const char*. Rewrite using Linux coding style. Also, remove dead function from box/sql/delete.c Part of #3235
Legacy SQL DD structs contained sort_order, defined per index column. During integration, those structs are to be vanished. So, introduce new field to part entity of Tarantool. This field states for sorting order of given part in give index. This field is ignored by Tarantool everywhere excpept for some of nested queries in SQL. Patch also replaces usages of SQL's stored sort order w/ this new field. Part of #3235
KeyInfo is a legacy struct which was heavily used in SQL front-end. This patch replaces all its usages w/ Tarantool's natural key description structure called key_def. This change is a prt of data dictionary intagration effort: Tarantool indexes don't aware of KeyInfo, that is why it was evicted. Legacy KeyInfo memory handling was ref-counting based and now is replaced w/ memory duplication. This state of affairs should be improved in future. Part of #3235
Legacy SQL DD structs contained sort_order, defined per index column. During integration, those structs are to be vanished. So, introduce new field to part entity of Tarantool. This field states for sorting order of given part in give index. This field is ignored by Tarantool everywhere excpept for some of nested queries in SQL. Patch also replaces usages of SQL's stored sort order w/ this new field. Part of #3235
KeyInfo is a legacy struct which was heavily used in SQL front-end. This patch replaces all its usages w/ Tarantool's natural key description structure called key_def. This change is a part of data dictionary integration effort: Tarantool indexes don't aware of KeyInfo, that is why it was evicted. Legacy KeyInfo memory handling was ref-counting based and now is replaced w/ memory duplication. This state of affairs should be improved in future. Part of #3235
Legacy SQL DD structs contained sort_order, defined per index column. During integration, those structs are to be vanished. So, introduce new field to part entity of Tarantool. This field states for sorting order of given part in give index. This field is ignored by Tarantool everywhere excpept for some of nested queries in SQL. Patch also replaces usages of SQL's stored sort order w/ this new field. Part of #3235
KeyInfo is a legacy struct which was heavily used in SQL front-end. This patch replaces all its usages w/ Tarantool's natural key description structure called key_def. This change is a part of data dictionary integration effort: Tarantool indexes don't aware of KeyInfo, that is why it was evicted. Legacy KeyInfo memory handling was ref-counting based and now is replaced w/ memory duplication. This state of affairs should be improved in future. Part of #3235
Legacy SQL DD structs contained sort_order, defined per index column. During integration, those structs are to be vanished. So, introduce new field to part entity of Tarantool. This field states for sorting order of given part in give index. This field is ignored by Tarantool everywhere excpept for some of nested queries in SQL. Patch also replaces usages of SQL's stored sort order w/ this new field. Part of #3235
KeyInfo is a legacy struct which was heavily used in SQL front-end. This patch replaces all its usages w/ Tarantool's natural key description structure called key_def. This change is a part of data dictionary integration effort: Tarantool indexes don't aware of KeyInfo, that is why it was evicted. Legacy KeyInfo memory handling was ref-counting based and now is replaced w/ memory duplication. This state of affairs should be improved in future. Part of #3235
There're many cases in SQL FE, where exact key def passed to doesn't ephemeral table matter. It is used to store data only. Only field count makes sense in such a case. Hoewever it is passed separately (in P2). So, allow P4 field to be NULL for OP_OpenTEphemeral. Update delte from routine from sql/delete.c accordingly. Part of #3235
Refactor DELETE FROM statements translation, update all live routines according to Tarantool's coding style. Use key_def instead of Table* where possible. Remove useless index delete routine as well. Part of #3235
Refactor DELETE FROM statements translation, update all live routines according to Tarantool's coding style. Use key_def instead of Table* where possible. Remove useless index delete routine as well. Part of #3235
There're many cases in SQL FE, where exact key def passed to doesn't ephemeral table matter. It is used to store data only. Only field count makes sense in such a case. Hoewever it is passed separately (in P2). So, allow P4 field to be NULL for OP_OpenTEphemeral. Update delte from routine from sql/delete.c accordingly. Part of #3235
Legacy SQL FE was able to create indexes w/ expressions. Tarantool will employ diofferenct scheme to implement functional indexes, thus code handling it in SQL FE is dead and redundant. Remove it. Part of #3235
This patch implements support of SQL's DELETE statemets which a accompanied by point WHERE point constraints. This patch doesn't support any kinds of nested selects or JOINs. Part of #3235
This small patch removes usages of primary index throughout code sql_table_delete_from, limiting use to fetching of affinities only. We cannot use space_def here, since primary index might contain calculated columns. Part of #3235
Legacy SQL FE was able to create indexes w/ expressions. Tarantool will employ diofferenct scheme to implement functional indexes, thus code handling it in SQL FE is dead and redundant. Remove it. Part of #3235
This patch implements support of SQL's DELETE statemets which a accompanied by point WHERE point constraints. This patch doesn't support any kinds of nested selects or JOINs. Part of #3235
This patch implements support of SQL's DELETE statemets which a accompanied by point WHERE point constraints. This patch doesn't support any kinds of nested selects or JOINs. Part of #3235
This small patch removes usages of primary index throughout code sql_table_delete_from, limiting use to fetching of affinities only. We cannot use space_def here, since primary index might contain calculated columns. Part of #3235
Legacy SQL FE was able to create indexes w/ expressions. Tarantool will employ diofferenct scheme to implement functional indexes, thus code handling it in SQL FE is dead and redundant. Remove it. Part of #3235
This patch implements support of SQL's DELETE statemets which a accompanied by point WHERE point constraints. This patch doesn't support any kinds of nested selects or JOINs. Part of #3235
Legacy SQL FE was able to create indexes w/ expressions. Tarantool will employ diofferenct scheme to implement functional indexes, thus code handling it in SQL FE is dead and redundant. Remove it. Part of #3235
This patch implements support of SQL's DELETE statemets which a accompanied by point WHERE point constraints. This patch doesn't support any kinds of nested selects or JOINs. Part of #3235
After all, the only artefact remained is |
Completely removes struct Table. Also the patch simplifies memory management as in many cases struct space (which replaces struct Table) is allocated on region and shouldn't be explicitly freed. Closes #3235
Completely removes struct Table. Also the patch simplifies memory management as in many cases struct space (which replaces struct Table) is allocated on region and shouldn't be explicitly freed. Closes #3235
Completely removes struct Table. Also the patch simplifies memory management as in many cases struct space (which replaces struct Table) is allocated on region and shouldn't be explicitly freed. Closes #3235
Completely removes struct Table. Also the patch simplifies memory management as in many cases struct space (which replaces struct Table) is allocated on region and shouldn't be explicitly freed. Closes #3235
completely removes struct Table. Also the patch simplifies memory management as in many cases struct space (which replaces struct Table) is allocated on region and shouldn't be explicitly freed. Closes #3235
Lets completely remove struct Table. Also the patch simplifies memory management as in many cases struct space (which replaces struct Table) is allocated on region and shouldn't be explicitly freed. Some wrappers fetching data from space (such as space_checks_expr_list) have been removed since now we can get all properties right from space object right from cache. Closes #3235
Lets completely remove struct Table. Also the patch simplifies memory management as in many cases struct space (which replaces struct Table) is allocated on region and shouldn't be explicitly freed. Some wrappers fetching data from space (such as space_checks_expr_list) have been removed since now we can get all properties right from space object right from cache. Closes #3235
Lets completely remove struct Table. Also the patch simplifies memory management as in many cases struct space (which replaces struct Table) is allocated on region and shouldn't be explicitly freed. Some wrappers fetching data from space (such as space_checks_expr_list) have been removed since now we can get all properties right from space object right from cache. Closes #3235
Lets completely remove struct Table. Also the patch simplifies memory management as in many cases struct space (which replaces struct Table) is allocated on region and shouldn't be explicitly freed. Some wrappers fetching data from space (such as space_checks_expr_list) have been removed since now we can get all properties right from space object right from cache. Closes #3235
Lets completely remove struct Table. Also the patch simplifies memory management as in many cases struct space (which replaces struct Table) is allocated on region and shouldn't be explicitly freed. Some wrappers fetching data from space (such as space_checks_expr_list) have been removed since now we can get all properties right from space object right from cache. Closes #3235
One of biggest parts which still live in legacy DD of SQL are structures which
deal with expressions. They're:
struct Expr
struct ExprList
struct ExprSpan
Expr is used by:
struct Table
to store CHECK constraints. This should be moved tostruct space
struct Column
to store default value for table's column. Probably, this should be moved tostruct key_def
struct Index
to store WHERE clause for partial index. Probably should be moved tostruct index
.struct Index
to store functional index expression. E.g. if we're indexing on (a*a) field. Should go tostruct index
as well.The text was updated successfully, but these errors were encountered: