-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Add index to properties table #20716
Conversation
8cca823
to
4946e7c
Compare
Would be awesome to get this in 19. |
This speeds up access to folders with lots of files considerably. |
I'm pretty sure the odd test failure is not related to me adding indexes. |
is yours |
4946e7c
to
2db36ad
Compare
Thanks. |
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 think you may have accidentally committed composer.phar
?
2db36ad
to
9e2aecb
Compare
Good catch, fixed. |
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.
Please add to the check for the missing indices so that admins are notified about this:
Line 74 in cb05782
$eventDispatcher->addListener(IDBConnection::CHECK_MISSING_INDEXES_EVENT, |
Fix pushed. |
bad5a14
to
4243d5d
Compare
So lint is complaining about lib/private/Files/ObjectStore/Swift.php which I didn't touch and I can't run composer run cs:fix because it errors out with: Fatal error: Uncaught Error: Class 'Nextcloud\CodingStandard\Config' not found in /Users/mario/Projects/server/.php_cs.dist:9 |
It is already fixed in #20742 |
4243d5d
to
b94240c
Compare
d8cc68d
to
f282975
Compare
@MorrisJobke thanks, fixed. Thanks to you and @icewind1991 for mentoring, and @gary-kim and @ChristophWurst of course! :) |
use OCP\Migration\IOutput; | ||
use OCP\Migration\SimpleMigrationStep; | ||
|
||
class Version19000Date20200429140134 extends SimpleMigrationStep { |
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 just noticed that you want to do this in a migration. Then the step in the "add-missing-indices" is not needed. I guess we should not do the migration here (because it can take really long and thus break the update). Better is to put the addIndex()
to an old migration, so that it is executed on new installs. And for existing installations we do the approach with the admin notification and the add-missing-indices command to add the index while the instance is online.
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.
@mario I just noticed that I had this as pending open. That's why I said that in the chat back then ;)
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.
What migration do you want me to put it in @MorrisJobke ?
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.
Right below that line I would say:
$table->setPrimaryKey(['userid', 'appid', 'configkey']); |
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.
Just for reference - that's how we did it for other indices as well: https://github.com/nextcloud/server/pull/13213/files
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.
You just confused the hell out of me - I hope you meant few lines further where the migration for properties is, and not preferences? :D
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.
This is for preferences, I need it for properties :P But found it, thanks!
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.
Ah yes - sorry. Far better now 👍
Signed-off-by: Mario Danic <mario@lovelyhq.com>
Let's hope its good now :p |
f282975
to
6e28c28
Compare
Will this be back-ported to a minor v18 release? |
Signed-off-by: Mario Danic mario@lovelyhq.com