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

feat(1329): System table for system variables #1342

Merged
merged 1 commit into from
Jun 6, 2024

Conversation

joshua-spacetime
Copy link
Collaborator

Closes #1329.

Used to persist global parameters for slow query logging and cardinality limits.

Expected complexity level and risk

2

Testing

Describe any testing you've done, and any testing you'd like your reviewers to do,
so that you're confident that all the changes work as expected!

  • Write a test you've completed here.
  • Write a test you want a reviewer to do here, so they can check it off when they're satisfied.

@joshua-spacetime joshua-spacetime marked this pull request as ready for review June 5, 2024 23:36
@mamcx
Copy link
Contributor

mamcx commented Jun 6, 2024

I think you need to mark this as potentially breaking because the table id of the new system table can clash with the user generated ones.


/// The type of a system variable in `st_var`
#[repr(u8)]
pub enum StVarType {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need another type for this? I think just matching on AlgebraicType if wanna restrict to primitive types is enough

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can a column be typed as AlgebraicValue? I was under the assumption it needed a concrete type. In this case, AlgebraicType::Sum(...).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could conceivably impl SpacetimeType for AlgebraicValue by having an AlgebraicType which describes AlgebraicValue.

) -> Result<(), DBError> {
if auth.caller != auth.owner {
if let Some(limit) = config.row_limit {
if let Some(limit) = StVarTable::row_limit(ctx, db, tx)? {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use the row_limit in st_var when estimating cardinality.

Copy link
Contributor

@mamcx mamcx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Closes #1329.

Used to persist global parameters for slow query logging and cardinality limits.
@joshua-spacetime joshua-spacetime added this pull request to the merge queue Jun 6, 2024
Merged via the queue into master with commit b3339c8 Jun 6, 2024
6 checks passed
@joshua-spacetime joshua-spacetime deleted the joshua/feat/sys-var-table branch June 6, 2024 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Keep SQL variables in a system table
3 participants