[Bug]: PostgreSQL: Some tables have many sequential scans and no index scans, suggesting a missing index.

Abierto
#66,563 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
1-2 días
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
docker, php, postgresql
Área
cli, databases

Línea de trabajo

Start with the occ db:add-missing-indices command and the missing-index check shown in the Server info database section, then reproduce on a PostgreSQL instance. Work out why the command reports nothing for the listed tables, such as oc_mounts. Done means the command creates the indexes on PostgreSQL or the report is corrected, with a test covering the case. The issue has no comments yet, so ask a maintainer for direction early.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

0. Needs triage 35-feedback bug
⚠️ This issue respects the following points: ⚠️
  • This is not a troubleshooting question, general support matter, or webserver/proxy problem, but likely a bug (if unsure, ask the Community Help Forum).
  • This issue is not already reported on Github OR solved at the Community Help Forum (I've searched!).
  • I'm using a maintained major version of Nextcloud Server and tested against the latest patch level. (Supported major versions and current patch levels).
  • I agree to follow Nextcloud's Code of Conduct.
  • I've tried my best to provide clear reproduction steps that someone unfamiliar with this bug could use to reproduce it.
Bug description

NC Serverinfo says I should add some indexes to NC tables but occ db:add-missing-indices does nothing.
Looks like the same problem as described here: https://help.nextcloud.com/t/missing-index-oc-mounts/251576

Steps to reproduce
  1. Open <domain>/settings/admin/serverinfo#database
  2. See the Error below
  3. SSH into your server and run
    docker exec --user www-data nextcloud-aio-nextcloud php /var/www/html/occ db:add-missing-indices
  4. Get no output -> So no indexes were added
Bildschirmfoto vom 2026-11-13 15-10-50
Expected behavior

The indexes for the tables in the picture above should have been created.

Nextcloud Server version

35

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.4

Web server

Apache (supported)

Database engine version

PostgreSQL

Is this bug present after an update or on a fresh install?

Upgraded to a MAJOR version (ex. 31 to 32)

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

What user-backends are you using?
  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other
Configuration report
{
    "system": {
        "one-click-instance": true,
        "one-click-instance.user-limit": 100,
        "memcache.local": "\\OC\\Memcache\\APCu",
        "apps_paths": [
            {
                "path": "\/var\/www\/html\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/www\/html\/custom_apps",
                "url": "\/custom_apps",
                "writable": true
            }
        ],
        "appsallowlist": false,
        "check_data_directory_permissions": false,
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "password": "***REMOVED SENSITIVE VALUE***",
            "port": 6379,
            "timeout": 3,
            "read_timeout": 10
        },
        "overwritehost": "***REMOVED BY ME***",
        "overwriteprotocol": "https",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "***REMOVED BY ME***",
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "pgsql",
        "version": "35.0.2.2",
        "overwrite.cli.url": "https:\/\/wolke.wellmann.wtf\/",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "maintenance": false,
        "loglevel": 2,
        "log_type": "file",
        "logfile": "\/var\/www\/html\/data\/nextcloud.log",
        "log_rotate_size": "10485760",
        "log.condition": {
            "apps": [
                "admin_audit"
            ]
        },
        "preview_max_x": 1024,
        "preview_max_y": 1024,
        "jpeg_quality": 60,
        "enabledPreviewProviders": {
            "0": "OC\\Preview\\Imaginary",
            "1": "OC\\Preview\\OpenDocument",
            "2": "OC\\Preview\\Movie",
            "3": "OC\\Preview\\Krita",
            "4": "OC\\Preview\\ImaginaryPDF",
            "5": "OC\\Preview\\HEIC",
            "6": "OC\\Preview\\ImaginaryPDF",
            "7": "OC\\Preview\\Image",
            "8": "OC\\Preview\\TIFF",
            "9": "OC\\Preview\\ImaginaryPDF",
            "10": "OC\\Preview\\ImaginaryPDF",
            "23": "OC\\Preview\\ImaginaryPDF"
        },
        "enable_previews": true,
        "upgrade.disable-web": true,
        "mail_smtpmode": "smtp",
        "trashbin_retention_obligation": "auto, 30",
        "versions_retention_obligation": "auto, 30",
        "activity_expire_days": "30",
        "simpleSignUpLink.shown": false,
        "share_folder": "\/Shared",
        "one-click-instance.link": "https:\/\/nextcloud.com\/all-in-one\/",
        "upgrade.cli-upgrade-link": "https:\/\/github.com\/nextcloud\/all-in-one\/discussions\/2726",
        "updatedirectory": "\/nc-updater",
        "allow_local_remote_servers": true,
        "davstorage.request_timeout": 3600,
        "htaccess.RewriteBase": "\/",
        "dbpersistent": false,
        "files_external_allow_create_new_local": true,
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "preview_imaginary_url": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauth": 1,
        "mail_sendmailmode": "smtp",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpsecure": "ssl",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "465",
        "default_phone_region": "DE",
        "default_locale": "de_DE",
        "default_language": "de",
        "default_timezone": "Europe\/Berlin",
        "allow_user_to_change_display_name": true,
        "skeletondirectory": "",
        "logtimezone": "Europe\/Berlin",
        "preview_concurrency_all": 16,
        "preview_concurrency_new": 8,
        "preview_max_memory": 1024,
        "sharing.minSearchStringLength": 1,
        "maintenance_window_start": 100,
        "preview_imaginary_key": "***REMOVED SENSITIVE VALUE***",
        "auth.bruteforce.protection.enabled": true,
        "ratelimit.protection.enabled": true,
        "documentation_url.server_logs": "https:\/\/github.com\/nextcloud\/all-in-one\/discussions\/5425",
        "memories.db.triggers.fcu": true,
        "memories.exiftool": "\/var\/www\/html\/custom_apps\/memories\/bin-ext\/eperl-amd64-musl",
        "memories.vod.path": "\/var\/www\/html\/custom_apps\/memories\/bin-ext\/go-vod-amd64",
        "memories.vod.ffmpeg": "\/usr\/bin\/ffmpeg",
        "memories.vod.ffprobe": "\/usr\/bin\/ffprobe",
        "updatechecker": false,
        "memories.gis_type": 2,
        "serverid": 445,
        "log_type_audit": "file",
        "logfile_audit": "\/var\/www\/html\/data\/audit.log",
        "update_channel": "stable",
        "memories.vips.path": "\/var\/www\/html\/custom_apps\/memories\/bin-ext\/vips-amd64",
        "data-fingerprint": "6e39f31f2865d74155debfb87c73b3eb",
        "enable_lazy_objects": false,
        "app_install_overwrite": [
            "deck",
            "dicomviewer",
            "fulltextsearch_elasticsearch",
            "files_fulltextsearch",
            "fulltextsearch",
            "files_automatedtagging",
            "assistant",
            "recognize",
            "integration_openai",
            "spreed",
            "socialsharing_bluesky",
            "socialsharing_diaspora",
            "socialsharing_facebook",
            "socialsharing_telegram",
            "socialsharing_twitter",
            "socialsharing_whatsapp",
            "workflow_ocr",
            "groupfolders",
            "money",
            "richdocuments"
        ],
        "DOMAIN": "***REMOVED BY ME***",
        "AIO_VERSION": "v15.0.2"
    }
}
List of activated Apps
Enabled:
  - activity: 8.0.0
  - admin_audit: 2.0.0
  - app_api: 35.0.0
  - appstore: 2.0.0
  - assistant: 4.1.0
  - bruteforcesettings: 8.0.0
  - calendar: 6.6.5
  - circles: 35.0.0
  - cloud_federation_api: 2.0.0
  - collectives: 4.8.0
  - comments: 2.0.0
  - contacts: 8.10.0
  - contactsinteraction: 2.0.0
  - context_chat: 5.5.0
  - cookbook: 0.11.12
  - cospend: 4.3.0
  - dashboard: 8.0.0
  - dav: 2.0.0
  - deck: 1.19.2
  - dicomviewer: 2.4.0
  - duplicatefinder: 1.10.4
  - eidlogin: 1.0.23
  - end_to_end_encryption: 2.6.0
  - federatedfilesharing: 2.0.0
  - files: 3.0.0
  - files_antivirus: 6.5.0
  - files_archive: 1.3.1
  - files_automatedtagging: 6.0.1
  - files_bpm: 1.8.4
  - files_downloadlimit: 5.3.0
  - files_external: 2.0.0
  - files_fulltextsearch: 35.0.1
  - files_lock: 35.0.1
  - files_pdfviewer: 8.0.0
  - files_reminders: 2.0.0
  - files_sharing: 2.0.0
  - files_trashbin: 2.0.0
  - files_versions: 2.0.0
  - firstrunwizard: 8.0.0
  - forms: 5.4.2
  - forum: 1.7.0
  - fulltextsearch: 35.0.1
  - fulltextsearch_elasticsearch: 35.0.1
  - groupfolders: 23.0.1
  - integration_openai: 5.0.0
  - keepassnc: 1.2.0
  - logreader: 8.0.0
  - lookup_server_connector: 2.0.0
  - mail: 5.13.2
  - maps: 1.8.0
  - memories: 11.1.2
  - money: 0.32.0
  - music: 3.3.1
  - news: 29.0.0
  - nextcloud-aio: 0.9.0
  - nextcloud_announcements: 7.0.0
  - notes: 6.1.1
  - notifications: 8.0.1
  - notify_push: 1.4.2
  - oauth2: 2.0.0
  - office: 1.1.0
  - password_policy: 7.0.0
  - passwords: 2026.11.20
  - photos: 8.0.0
  - polls: 9.3.0
  - previewgenerator: 5.15.0
  - privacy: 7.0.0
  - profile: 2.0.0
  - provisioning_api: 2.0.0
  - qownnotesapi: 26.8.1
  - recognize: 13.2.0
  - recommendations: 8.0.0
  - related_resources: 6.0.0
  - richdocuments: 12.0.2
  - serverinfo: 7.0.0
  - settings: 2.0.0
  - sharebymail: 2.0.0
  - sharing: 1.0.4
  - socialsharing_bluesky: 5.0.3
  - socialsharing_diaspora: 5.0.3
  - socialsharing_email: 5.0.3
  - socialsharing_facebook: 5.0.3
  - socialsharing_telegram: 5.0.3
  - socialsharing_twitter: 5.0.3
  - socialsharing_whatsapp: 5.0.3
  - spreed: 25.0.8
  - support: 7.0.0
  - suspicious_login: 13.0.0
  - systemtags: 2.0.0
  - tables: 2.4.0
  - tasks: 0.18.1
  - text: 9.0.1
  - theming: 3.0.0
  - twofactor_backupcodes: 2.0.0
  - twofactor_nextcloud_notification: 9.0.0
  - twofactor_totp: 17.1.0
  - updatenotification: 2.0.0
  - user_status: 2.0.0
  - viewer: 8.0.0
  - weather_status: 2.0.0
  - webhook_listeners: 2.0.0
  - whiteboard: 2.1.2
  - workflow_ocr: 1.35.0
  - workflowengine: 3.0.0
Nextcloud Signing status
No entries here
Nextcloud Logs
Nothing relevant here
Additional info

No response

Lenguaje dominante
PHP
Estrellas
37.6k
Forks
5.4k
Merge medio
1 d 13 h
PR fusionados (30 d)
623

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de nextcloud/server

Todos los issues de nextcloud/server

Issues similares

Más issues de PHP

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.