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

Store aggregates without separate tables (e.g. combine post and post_aggregates) #4869

Open
dullbananas opened this issue Jun 25, 2024 · 2 comments

Comments

@dullbananas
Copy link
Collaborator

This would get rid of a lot of complexity. It would also reduce the chance of things that have been big problems before: trigger bugs, and queries that can't efficiently use indexes.

Diesel's 32 column limit makes this hard. The first thing that should be done is to create a crate with just the schema.rs file, enable the 64 columns feature, apply the changes in schema.rs, and measure the incremental compile time difference using cargo timings. One of these things about the compile time increase caused by the 64 columns feature might be revealed:

  • It's not as bad as before
  • It's outweighed by a compile time decrease caused by the reduced amount of table pairs generated by the allow_tables_to_appear_in_same_query macro
@dessalines
Copy link
Member

dessalines commented Jul 7, 2024

I wouldn't be opposed, but yeah the increase in compile time would be an issue.

You could test the difference by just adding that diesel feature. I believe it'll increase the compile time even if no table has past 32 columns.

@Nutomic
Copy link
Member

Nutomic commented Jul 7, 2024

Yes the compile time increases directly after enabling the 64 column feature, no matter if you use them or not. Its because diesel has to generate a lot more code (macros?) to handle these extra columns. So to test the compile time difference, simply add 64 column feature to Lemmy's cargo.toml.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants