Skip to content

Conversation

@JohannesGGE
Copy link
Contributor

Summary

Remove index property_index and properties_pathonly_index because properties_path_index already covers column userid and propertypath

TODO

  • ...

Checklist

@JohannesGGE JohannesGGE self-assigned this Feb 4, 2024
@JohannesGGE JohannesGGE force-pushed the fix/42588/remove-redundant-indices branch from 8e39447 to bbbcc41 Compare February 4, 2024 22:58
@solracsf
Copy link
Member

solracsf commented Feb 5, 2024

Same as #43340 (comment)

@JohannesGGE JohannesGGE force-pushed the fix/42588/remove-redundant-indices branch 3 times, most recently from 0c798fe to 3c716c5 Compare February 5, 2024 11:34
Comment on lines 56 to 60
if ($tableProperties->hasIndex('properties_pathonly_index') &&
$tableProperties->hasIndex('properties_path_index')) {

$tableProperties->dropIndex('properties_pathonly_index');
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

properties_path_index is an index on (userid, propertypath). properties_pathonly_index is an index on (propertypath). The database can use properties_pathonly_index for queries on userid and userid+propertypath, but not for queries that only access propertypath.

In general, a database can use a concatenated index when searching with the leading (leftmost) columns. An index with three columns can be used when searching for the first column, when searching with the first two columns together, and when searching using all columns.

https://use-the-index-luke.com/sql/where-clause/the-equals-operator/concatenated-keys

Copy link
Member

@ChristophWurst ChristophWurst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

properties_pathonly_index must stay

@JohannesGGE JohannesGGE force-pushed the fix/42588/remove-redundant-indices branch from dac73c9 to 21e8aad Compare February 18, 2024 20:03
Copy link
Member

@ChristophWurst ChristophWurst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😎

@ChristophWurst ChristophWurst added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Feb 19, 2024
@JohannesGGE JohannesGGE merged commit 1bc8129 into master Feb 19, 2024
@JohannesGGE JohannesGGE deleted the fix/42588/remove-redundant-indices branch February 19, 2024 14:20
@blizzz blizzz mentioned this pull request Mar 5, 2024
@joshtrichards joshtrichards mentioned this pull request Mar 17, 2025
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4. to release Ready to be released and/or waiting for tests to finish bug feature: caldav Related to CalDAV internals feature: dav performance 🚀

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Redundant properties.property_index index

5 participants