nextcloud / nextcloud/server

Convert `systemtag_object_mapping::object_id` to BIGINT?

Open
#34,859 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage feature: database feature: tags performance 🚀 technical debt
Dominant language
PHP
Stars
36.9k
Forks
5.2k
Avg merge
2d 3h
Merged PRs (30d)
713

Description

Currently systemtag_object_mapping::object_id is VARCHAR instead of BIGINT. Does this field store something other than file IDs? Due to the difference in type, JOINs against filecache are extremely slow because the whole table needs to be scanned.

https://github.com/nextcloud/server/blob/d007088cf5d89e29065991e0cbe2c890dfa13d96/core/Migrations/Version13000Date20170718121200.php#L738-L743

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with core/Migrations/Version13000Date20170718121200.php around lines 738-743 and trace how systemtag_object_mapping.object_id is populated and joined with filecache. Establish whether the field contains only file IDs, then confirm the schema change preserves existing values and removes the reported slow full-table scan.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
database, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.