-
Notifications
You must be signed in to change notification settings - Fork 68
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 metadata by default in a json(b) column in the lines table #178
Conversation
722ca5e
to
c219373
Compare
@orien any thoughts? I'd love to get this merged in for the 2.0 release. |
Happy New Year @orien 🎉 Any chance you could take a look at this soon? Thanks! |
Happy new year @swrobel! I'm loving this change. Thanks heaps. |
Great! I'd love your thoughts on indexes, if you have any |
To focus the discussion, it seems that the current index on the If you agree, @orien, I would consider this ready to merge. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Users can invividually add this index if they need to support such queries.
I agree. There's nothing in this gem that queries the metadata. This is left for individual teams to decide which select
s will be performed and thus which indexes will be optimal.
envato/double_entry-reporting provides one example although that is in desperate need of documenting.
c219373
to
3faa32a
Compare
@orien requested changes were made |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy with the change, just have a question about using the config for conditionally requiring the line_metadata
module.
3faa32a
to
800d610
Compare
@ricobl I believe I've implemented a fix that should work for both configurations. |
800d610
to
f6586bc
Compare
This is my attempt at improving performance of metadata storage by moving it from a separate key/value table into the lines table. The results of tests seem to show a substantial improvement on my machine:
This is achieved via a default for new installs, which sets
config.json_metadata = true
in an initializer, which is also newly generated by the installer. The default value isfalse
, so existing installs should work just fine with the old metadata table. I have tests in place for both scenarios.It's worth noting that I haven't added any indexes on the metadata column. I know that for Postgres, efficient querying is possible using a gin index. However I'm not sure about MySQL, and I honestly doubt it matters for SQLite since that's presumably just used for development. I'd be interested in input on that subject.