Skip to content

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.

@yliang412
Copy link
Member Author

implement part of this in #22

@yliang412 yliang412 closed this Feb 10, 2025
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