Skip to content

perf(storage_mapping): Use oc_filecache.path_hash which is covered by an index#683

Open
provokateurin wants to merge 1 commit intomainfrom
perf/storage-mapping/path-hash
Open

perf(storage_mapping): Use oc_filecache.path_hash which is covered by an index#683
provokateurin wants to merge 1 commit intomainfrom
perf/storage-mapping/path-hash

Conversation

@provokateurin
Copy link
Member

Depends on icewind1991/cross-naersk#1

On PostgreSQL no index exists for oc_filecache.path and on all other DBs it is only a partial index: https://github.com/nextcloud/server/blob/b729dc4eadfe78d6d5c41775378a04b8d4177482/core/Migrations/Version13000Date20170718121200.php#L244-L244
With enough users on the instance, this query can become very slow, especially on PostgreSQL.

@provokateurin provokateurin requested a review from Altahrim March 2, 2026 13:03
@provokateurin provokateurin force-pushed the perf/storage-mapping/path-hash branch 2 times, most recently from ac62dd6 to 21c214b Compare March 2, 2026 15:11
@icewind1991 icewind1991 force-pushed the perf/storage-mapping/path-hash branch from 21c214b to 1ef0d2e Compare March 2, 2026 16:14
… an index

Signed-off-by: provokateurin <kate@provokateurin.de>
@icewind1991 icewind1991 force-pushed the perf/storage-mapping/path-hash branch from 1ef0d2e to 08c11c0 Compare March 2, 2026 16:47
@provokateurin
Copy link
Member Author

Why did you revert the flake changes? I was not able to get a devshell without icewind1991/cross-naersk#1 (even without updating anything else).

@provokateurin
Copy link
Member Author

So the index doesn't matter, but this is still an improvement due to requiring less data being selected (path vs. path_hash width).

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant