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

[POC] feat: storage for optimizer core objects #9

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

yliang412
Copy link
Member

@yliang412 yliang412 commented Jan 20, 2025

Problem

Persistence storage is on top of the optd optimizer wishlist.

Summary of changes

This PR models the storage for optimizer core objects in SQLite using diesel-rs.

  • Models core object relationships in SQL.
  • use diesel-rs to codegen schema and dsl.
  • Adds "new type identifiers and from/to SQL conversion (e.g. RelGroupId, RelSubGroupId, LogicalExprId, etc.).
  • Add developer docs on how to use diesel-rs. Rendered

TODO:

  • Add developer docs on how to add new logical, physical, and scalar operators.
  • Add tests for memo table access methods.
  • Separate the definition for each table into a separate file.
  • Determine whether indexes are needed (or SQLite pkey is enough).

Future work

  • Use the "table inheritance" pattern for logical, physical, and scalar properties.

Signed-off-by: Yuchen Liang <[email protected]>
Signed-off-by: Yuchen Liang <[email protected]>
Signed-off-by: Yuchen Liang <[email protected]>
Signed-off-by: Yuchen Liang <[email protected]>
@yliang412 yliang412 marked this pull request as draft January 20, 2025 19:35
Signed-off-by: Yuchen Liang <[email protected]>
Signed-off-by: Yuchen Liang <[email protected]>
@yliang412
Copy link
Member Author

@connortsui20 Should we do build with source? The CI is probably not happy with linking with sqlite3.

On another note, do we want to install the diesel CLI on the CI images?

@yliang412
Copy link
Member Author

bundled libsqlite3-sys to resolve build problems.

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.

1 participant