-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
perf(preview): Split preview data to new table #54543
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
Conversation
Altahrim
left a comment
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.
Quick thoughts on the new table
43b105b to
0447f56
Compare
663dfd5 to
e55c56d
Compare
f6ddec7 to
24dc8a1
Compare
|
@icewind1991 some questions for you :)
|
|
Possible performance regression detected Show Output |
1 similar comment
|
Possible performance regression detected Show Output |
9b52d71 to
7d3c7e8
Compare
7d3c7e8 to
296b349
Compare
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.
- Do we have a way to garbage collect orphan previews? Was answered during our call.
296b349 to
f90075f
Compare
The new oc_previews table is optimized for storing previews and should decrease significantly the space taken by previews in the filecache table. This attend to reuse the IObjectStore abstraction over S3/Swift/Azure but currently only support one single bucket configuration. Signed-off-by: Carl Schwan <[email protected]>
Signed-off-by: Carl Schwan <[email protected]>
Signed-off-by: Carl Schwan <[email protected]>
Signed-off-by: Carl Schwan <[email protected]>
Signed-off-by: Carl Schwan <[email protected]>
* Simplify migration by not moving the actual files and just updating the DB * Don't store the storageid in the preview table as it is not needed * Start adding tests Signed-off-by: Carl Schwan <[email protected]>
Signed-off-by: Carl Schwan <[email protected]>
Signed-off-by: Carl Schwan <[email protected]>
This work similarly to the move preview job to migrate the previews to the new DB table and also reuse some code. So when we are finding files in appdata/preview, try adding them to the oc_previews table and delete them from the oc_filecache table. Signed-off-by: Carl Schwan <[email protected]>
Allow to quickly query all the files from a specific mimetype like in the ResetRenderedTexts command. Signed-off-by: Carl Schwan <[email protected]>
Signed-off-by: Carl Schwan <[email protected]>
Signed-off-by: Carl Schwan <[email protected]>
b1c9a14 to
9b63d58
Compare
9b63d58 to
12b77eb
Compare
12b77eb to
f91ea9e
Compare
And move it to a different table so that we don't have to pay the storage cost when not using it (most of the times). Signed-off-by: Carl Schwan <[email protected]>
Simplify logic Signed-off-by: Carl Schwan <[email protected]>
f91ea9e to
fed7a33
Compare
|
🎉🎉🎉🎉🎉 |
| if (!$schema->hasTable('preview_versions')) { | ||
| $table = $schema->createTable('preview_versions'); | ||
| $table->addColumn('id', Types::BIGINT, ['autoincrement' => true, 'notnull' => true, 'length' => 20, 'unsigned' => true]); | ||
| $table->addColumn('file_id', Types::BIGINT, ['notnull' => true, 'length' => 20, 'unsigned' => true]); |
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.
Uneducated guess, but an this smells like it will be the primary column to look up rows. Add an index?
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.
The mapper confirms that an index on file_id+version would be beneficial :)
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.
Summary
The new oc_previews table is optimized for storing previews and should decrease significantly the space taken by previews in the filecache table.
This attend to reuse the IObjectStore abstraction over S3/Swift/Azure but currently only support one single bucket configuration.
TODO
TODO moved to seperate MR
Checklist
Screenshots before/after for front-end changesShould not contains any visual changes ;)Backports requested where applicable (ex: critical bugfixes)