Steps to reproduce
use mysql/Mariadb
Expected behaviour
Tell us what should happen
search will show some results(files)
Actual behaviour
Since version 20 file serach does not work at all
it show "No results", even if query in database stil running
After I tape some word in search field, i can see many queryes in database:
SELECT
`file`.`fileid`,
`storage`,
`path`,
`path_hash`,
`file`.`parent`,
`name`,
`mimetype`,
`mimepart`,
`size`,
`mtime`,
`storage_mtime`,
`encrypted`,
`etag`,
`permissions`,
`checksum`,
`metadata_etag`,
`creation_time`,
`upload_time`
FROM
`oc_filecache` `file`
LEFT JOIN `oc_filecache_extended` `fe` ON
`file`.`fileid` = `fe`.`fileid`
WHERE
(`storage` = 255)
AND (`name` COLLATE utf8mb4_general_ci LIKE '%pu%')
ORDER BY
`mtime` desc
LIMIT 5
SELECT
`file`.`fileid`,
`storage`,

`path`,
`path_hash`,
`file`.`parent`,
`name`,
`mimetype`,
`mimepart`,
`size`,
`mtime`,
`storage_mtime`,
`encrypted`,
`etag`,
`permissions`,
`checksum`,
`metadata_etag`,
`creation_time`,
`upload_time`
FROM
`oc_filecache` `file`
LEFT JOIN `oc_filecache_extended` `fe` ON
`file`.`fileid` = `fe`.`fileid`
WHERE
(`storage` = 255)
AND (`name` COLLATE utf8mb4_general_ci LIKE '%puzzle%')
ORDER BY
`mtime` desc
LIMIT 5
sometimes more - 1 query for each simbol after two entered
and than for each shared folder new query another query with other STORAGE
I think, than's becouse LIMIT in query.
each of this query can take 3-5 minutes.
if I manualy run this query, but withount LIMIT it take 200 ms
most of the time my db server is working on a dozen similar queries
Can you, please, do not use LIMIT in mysql queries.
or use LIMIT like that
(SELECT
`file`.`fileid`,
`storage`,
`path`,
`path_hash`,
`file`.`parent`,
`name`,
`mimetype`,
`mimepart`,
`size`,
`mtime`,
`storage_mtime`,
`encrypted`,
`etag`,
`permissions`,
`checksum`,
`metadata_etag`,
`creation_time`,
`upload_time`
FROM
`oc_filecache` `file`
LEFT JOIN `oc_filecache_extended` `fe` ON
`file`.`fileid` = `fe`.`fileid`
WHERE
(`storage` = 255)
AND (`name` COLLATE utf8mb4_general_ci LIKE '%puzz%')
ORDER BY
`mtime` desc) t limit 5;
Server configuration
Centos 7.6
nginx/1.16.1
mariadb-server-10.5
PHP 8.0.11
21.0.4
Updated from an older Nextcloud
Signing status:
No
index.php/settings/integrity/failed:
No errors have been found.
List of activated apps:
Enabled:
- accessibility: 1.7.0
- activity: 2.14.3
- admin_audit: 1.11.0
- auto_groups: 1.3.1
- calendar: 2.3.4
- cloud_federation_api: 1.4.0
- comments: 1.11.0
- contacts: 4.0.3
- contactsinteraction: 1.2.0
- dashboard: 7.1.0
- dav: 1.17.1
- federatedfilesharing: 1.11.0
- files: 1.16.0
- files_external: 1.12.0
- files_pdfviewer: 2.1.0
- files_rightclick: 1.0.0
- files_sharing: 1.13.1
- files_trashbin: 1.11.0
- files_versions: 1.14.0
- files_videoplayer: 1.10.0
- firstrunwizard: 2.10.0
- forms: 2.3.0
- impersonate: 1.8.0
- logreader: 2.6.0
- lookup_server_connector: 1.9.0
- nextcloud_announcements: 1.10.0
- notifications: 2.9.0
- oauth2: 1.9.0
- password_policy: 1.11.0
- photos: 1.3.0
- privacy: 1.5.0
- provisioning_api: 1.11.0
- recommendations: 1.0.0
- richdocuments: 4.2.3
- serverinfo: 1.11.0
- settings: 1.3.0
- sharebymail: 1.11.0
- support: 1.4.0
- survey_client: 1.9.0
- text: 3.2.0
- theming: 1.12.0
- twofactor_backupcodes: 1.10.0
- updatenotification: 1.11.0
- user_ldap: 1.11.0
- user_status: 1.1.1
- viewer: 1.5.0
- weather_status: 1.1.0
- workflowengine: 2.3.0
Disabled:
- encryption
- federation
- systemtags
Nextcloud configuration:
{
"system": {
"instanceid": "***REMOVED SENSITIVE VALUE***",
"passwordsalt": "***REMOVED SENSITIVE VALUE***",
"secret": "***REMOVED SENSITIVE VALUE***",
"trusted_domains": [
"iscloud.is74.ru"
],
"datadirectory": "***REMOVED SENSITIVE VALUE***",
"overwrite.cli.url": "https:\/\/iscloud.is74.ru\/",
"dbtype": "mysql",
"version": "21.0.4.1",
"dbname": "***REMOVED SENSITIVE VALUE***",
"dbhost": "***REMOVED SENSITIVE VALUE***",
"dbtableprefix": "oc_",
"dbuser": "***REMOVED SENSITIVE VALUE***",
"dbpassword": "***REMOVED SENSITIVE VALUE***",
"trashbin_retention_obligation": "auto, 90",
"versions_retention_obligation": "auto, 30",
"activity_expire_days": "90",
"logtimezone": "Asia\/Yekaterinburg",
"installed": true,
"ldapIgnoreNamingRules": false,
"logfile": "\/var\/log\/nextcloud\/nextcloud.log",
"loglevel": 1,
"debug": true,
"log_authfailip": true,
"maintenance": false,
"mail_from_address": "***REMOVED SENSITIVE VALUE***",
"mail_smtpmode": "smtp",
"mail_domain": "***REMOVED SENSITIVE VALUE***",
"filelocking.enabled": true,
"memcache.locking": "\\OC\\Memcache\\Redis",
"theme": "",
"htaccess.RewriteBase": "\/",
"app.mail.accounts.default": {
"email": "%USERID%@intersvyaz.net",
"imapHost": "exch.is74.ru",
"imapUser": "%USERID%",
"imapPort": 143,
"imapSslMode": "tls",
"smtpHost": "exch.is74.ru",
"smtpUser": "%USERID%",
"smtpPort": 587,
"smtpSslMode": "tls"
},
"ldapProviderFactory": "\\OCA\\User_LDAP\\LDAPProviderFactory",
"memcache.distributed": "\\OC\\Memcache\\Redis",
"memcache.local": "\\OC\\Memcache\\APCu",
"redis": {
"host": "***REMOVED SENSITIVE VALUE***",
"port": 6379
},
"updater.release.channel": "stable",
"mail_smtpauthtype": "LOGIN",
"mysql.utf8mb4": true,
"mail_smtpsecure": "tls",
"mail_sendmailmode": "smtp",
"mail_smtphost": "***REMOVED SENSITIVE VALUE***",
"mail_smtpport": "25",
"default_phone_region": "RU",
"updater.secret": "***REMOVED SENSITIVE VALUE***"
}
}
Are you using external storage, if yes which one: s3
**Are you using encryption:**no
Are you using an external user-backend, if yes which one: LDAP

Steps to reproduce
use mysql/Mariadb
Expected behaviour
Tell us what should happen
search will show some results(files)
Actual behaviour
Since version 20 file serach does not work at all
it show "No results", even if query in database stil running
After I tape some word in search field, i can see many queryes in database:
sometimes more - 1 query for each simbol after two entered
and than for each shared folder new query another query with other
STORAGEI think, than's becouse
LIMITin query.each of this query can take 3-5 minutes.
if I manualy run this query, but withount
LIMITit take 200 msmost of the time my db server is working on a dozen similar queries
Can you, please, do not use LIMIT in mysql queries.
or use
LIMITlike thatServer configuration
Centos 7.6
nginx/1.16.1
mariadb-server-10.5
PHP 8.0.11
21.0.4
Updated from an older Nextcloud
Signing status:
index.php/settings/integrity/failed:
List of activated apps:
Enabled: - accessibility: 1.7.0 - activity: 2.14.3 - admin_audit: 1.11.0 - auto_groups: 1.3.1 - calendar: 2.3.4 - cloud_federation_api: 1.4.0 - comments: 1.11.0 - contacts: 4.0.3 - contactsinteraction: 1.2.0 - dashboard: 7.1.0 - dav: 1.17.1 - federatedfilesharing: 1.11.0 - files: 1.16.0 - files_external: 1.12.0 - files_pdfviewer: 2.1.0 - files_rightclick: 1.0.0 - files_sharing: 1.13.1 - files_trashbin: 1.11.0 - files_versions: 1.14.0 - files_videoplayer: 1.10.0 - firstrunwizard: 2.10.0 - forms: 2.3.0 - impersonate: 1.8.0 - logreader: 2.6.0 - lookup_server_connector: 1.9.0 - nextcloud_announcements: 1.10.0 - notifications: 2.9.0 - oauth2: 1.9.0 - password_policy: 1.11.0 - photos: 1.3.0 - privacy: 1.5.0 - provisioning_api: 1.11.0 - recommendations: 1.0.0 - richdocuments: 4.2.3 - serverinfo: 1.11.0 - settings: 1.3.0 - sharebymail: 1.11.0 - support: 1.4.0 - survey_client: 1.9.0 - text: 3.2.0 - theming: 1.12.0 - twofactor_backupcodes: 1.10.0 - updatenotification: 1.11.0 - user_ldap: 1.11.0 - user_status: 1.1.1 - viewer: 1.5.0 - weather_status: 1.1.0 - workflowengine: 2.3.0 Disabled: - encryption - federation - systemtags
Nextcloud configuration:
{ "system": { "instanceid": "***REMOVED SENSITIVE VALUE***", "passwordsalt": "***REMOVED SENSITIVE VALUE***", "secret": "***REMOVED SENSITIVE VALUE***", "trusted_domains": [ "iscloud.is74.ru" ], "datadirectory": "***REMOVED SENSITIVE VALUE***", "overwrite.cli.url": "https:\/\/iscloud.is74.ru\/", "dbtype": "mysql", "version": "21.0.4.1", "dbname": "***REMOVED SENSITIVE VALUE***", "dbhost": "***REMOVED SENSITIVE VALUE***", "dbtableprefix": "oc_", "dbuser": "***REMOVED SENSITIVE VALUE***", "dbpassword": "***REMOVED SENSITIVE VALUE***", "trashbin_retention_obligation": "auto, 90", "versions_retention_obligation": "auto, 30", "activity_expire_days": "90", "logtimezone": "Asia\/Yekaterinburg", "installed": true, "ldapIgnoreNamingRules": false, "logfile": "\/var\/log\/nextcloud\/nextcloud.log", "loglevel": 1, "debug": true, "log_authfailip": true, "maintenance": false, "mail_from_address": "***REMOVED SENSITIVE VALUE***", "mail_smtpmode": "smtp", "mail_domain": "***REMOVED SENSITIVE VALUE***", "filelocking.enabled": true, "memcache.locking": "\\OC\\Memcache\\Redis", "theme": "", "htaccess.RewriteBase": "\/", "app.mail.accounts.default": { "email": "%USERID%@intersvyaz.net", "imapHost": "exch.is74.ru", "imapUser": "%USERID%", "imapPort": 143, "imapSslMode": "tls", "smtpHost": "exch.is74.ru", "smtpUser": "%USERID%", "smtpPort": 587, "smtpSslMode": "tls" }, "ldapProviderFactory": "\\OCA\\User_LDAP\\LDAPProviderFactory", "memcache.distributed": "\\OC\\Memcache\\Redis", "memcache.local": "\\OC\\Memcache\\APCu", "redis": { "host": "***REMOVED SENSITIVE VALUE***", "port": 6379 }, "updater.release.channel": "stable", "mail_smtpauthtype": "LOGIN", "mysql.utf8mb4": true, "mail_smtpsecure": "tls", "mail_sendmailmode": "smtp", "mail_smtphost": "***REMOVED SENSITIVE VALUE***", "mail_smtpport": "25", "default_phone_region": "RU", "updater.secret": "***REMOVED SENSITIVE VALUE***" } }
Are you using external storage, if yes which one: s3
**Are you using encryption:**no
Are you using an external user-backend, if yes which one: LDAP