Very slow Global Search (5 minutes)
Code of Conduct
- [x] I agree to follow this project's Code of Conduct
Is there an existing issue for this?
- [x] I have searched the existing issues
Version
10.0.18
Bug description
Hey,
We have noticed that the global search is very slow on our server, taking up to 5 minutes to load. We have a fairly well-stocked database because we've been using it for a while for several clients.
In debug mode, I've identified the request that seems to be causing the problem. Do you know how to fix it? The SQL query takes about 5 minutes and 30 seconds to complete
SQL Query :
SELECT DISTINCT `glpi_softwares`.`id` AS id, 'rlegal' AS currentuser,
`glpi_softwares`.`entities_id`, `glpi_softwares`.`is_recursive`, `glpi_softwares`.`name` AS `ITEM_Software_1`,
`glpi_softwares`.`id` AS `ITEM_Software_1_id`,
`glpi_entities`.`completename` AS `ITEM_Software_80`, `glpi_manufacturers`.`name` AS `ITEM_Software_23`, GROUP_CONCAT(DISTINCT CONCAT(IFNULL(`glpi_softwareversions`.`name`, '__NULL__'),
'$#$',`glpi_softwareversions`.`id`) ORDER BY `glpi_softwareversions`.`id` SEPARATOR '$$##$$')
AS `ITEM_Software_5`,
GROUP_CONCAT(DISTINCT CONCAT(IFNULL(`glpi_operatingsystems_0a35c270152be19b5c8a485502badcd7`.`name`, '__NULL__'),
'$#$',`glpi_operatingsystems_0a35c270152be19b5c8a485502badcd7`.`id`) ORDER BY `glpi_operatingsystems_0a35c270152be19b5c8a485502badcd7`.`id` SEPARATOR '$$##$$')
AS `ITEM_Software_4`,
COUNT(DISTINCT `glpi_items_softwareversions_37010ce8f4633da91ded3e0a4c256dc9`.`id`) AS `ITEM_Software_72`,
FLOOR(SUM(`glpi_softwarelicenses_4a402a7dd9d031ae77a0af53d4fa537b`.`number`)
* COUNT(DISTINCT `glpi_softwarelicenses_4a402a7dd9d031ae77a0af53d4fa537b`.`id`)
/ COUNT(`glpi_softwarelicenses_4a402a7dd9d031ae77a0af53d4fa537b`.`id`)) AS `ITEM_Software_163`,
MIN(`glpi_softwarelicenses_4a402a7dd9d031ae77a0af53d4fa537b`.`number`) AS `ITEM_Software_163_min`,
GROUP_CONCAT(DISTINCT CONCAT(IFNULL(`glpi_softwarelicenses_4a402a7dd9d031ae77a0af53d4fa537b`.`serial`, '__NULL__'),
'$#$',`glpi_softwarelicenses_4a402a7dd9d031ae77a0af53d4fa537b`.`id`) ORDER BY `glpi_softwarelicenses_4a402a7dd9d031ae77a0af53d4fa537b`.`id` SEPARATOR '$$##$$')
AS `ITEM_Software_161`,
GROUP_CONCAT(DISTINCT CONCAT(IFNULL(`glpi_softwarelicenses_4a402a7dd9d031ae77a0af53d4fa537b`.`otherserial`, '__NULL__'),
'$#$',`glpi_softwarelicenses_4a402a7dd9d031ae77a0af53d4fa537b`.`id`) ORDER BY `glpi_softwarelicenses_4a402a7dd9d031ae77a0af53d4fa537b`.`id` SEPARATOR '$$##$$')
AS `ITEM_Software_162`,
GROUP_CONCAT(DISTINCT CONCAT(IFNULL(`glpi_softwarelicenses_4a402a7dd9d031ae77a0af53d4fa537b`.`name`, '__NULL__'),
'$#$',`glpi_softwarelicenses_4a402a7dd9d031ae77a0af53d4fa537b`.`id`) ORDER BY `glpi_softwarelicenses_4a402a7dd9d031ae77a0af53d4fa537b`.`id` SEPARATOR '$$##$$')
AS `ITEM_Software_160`,
`glpi_users`.`name` AS `ITEM_Software_70`,
`glpi_users`.`realname` AS `ITEM_Software_70_realname`,
`glpi_users`.`id` AS `ITEM_Software_70_id`,
`glpi_users`.`firstname` AS `ITEM_Software_70_firstname` FROM `glpi_softwares`LEFT JOIN `glpi_entities`
ON (`glpi_softwares`.`entities_id` = `glpi_entities`.`id`
)LEFT JOIN `glpi_manufacturers`
ON (`glpi_softwares`.`manufacturers_id` = `glpi_manufacturers`.`id`
) LEFT JOIN `glpi_softwareversions`
ON (`glpi_softwares`.`id` = `glpi_softwareversions`.`softwares_id`
)LEFT JOIN `glpi_operatingsystems` AS `glpi_operatingsystems_0a35c270152be19b5c8a485502badcd7`
ON (`glpi_softwareversions`.`operatingsystems_id` = `glpi_operatingsystems_0a35c270152be19b5c8a485502badcd7`.`id`
) LEFT JOIN `glpi_items_softwareversions` AS `glpi_items_softwareversions_37010ce8f4633da91ded3e0a4c256dc9`
ON (`glpi_softwareversions`.`id` = `glpi_items_softwareversions_37010ce8f4633da91ded3e0a4c256dc9`.`softwareversions_id`
AND `glpi_items_softwareversions_37010ce8f4633da91ded3e0a4c256dc9`.`is_deleted_item` = '0' AND `glpi_items_softwareversions_37010ce8f4633da91ded3e0a4c256dc9`.`is_deleted` = '0' AND `glpi_items_softwareversions_37010ce8f4633da91ded3e0a4c256dc9`.`is_template_item` = '0' ) LEFT JOIN `glpi_softwarelicenses` AS `glpi_softwarelicenses_4a402a7dd9d031ae77a0af53d4fa537b`
ON (`glpi_softwares`.`id` = `glpi_softwarelicenses_4a402a7dd9d031ae77a0af53d4fa537b`.`softwares_id`
AND (`glpi_softwarelicenses_4a402a7dd9d031ae77a0af53d4fa537b`.`entities_id` IN ('0', '289', '63', '67', '318', '2', '79', '300', '116', '50', '323', '341', '422', '55', '345', '235', '379', '117', '287', '412', '7', '100', '331', '356', '84', '39', '322', '380', '69', '133', '53', '328', '76', '43', '384', '137', '354', '138', '62', '387', '339', '51', '390', '395', '355', '421', '333', '263', '363', '42', '428', '321', '234', '388', '81', '91', '377', '376', '378', '105', '83', '139', '430', '425', '140', '141', '18', '142', '146', '147', '236', '68', '103', '237', '239', '343', '314', '393', '407', '302', '427', '349', '8', '290', '342', '104', '57', '406', '429', '66', '102', '232', '101', '38', '85', '394', '17', '78', '361', '320', '80', '72', '423', '426', '240', '294', '71', '197', '293', '73', '54', '389', '424', '201', '286', '311', '200', '44', '92', '40', '3', '6', '4', '106', '107', '398', '114', '115', '108', '317', '109', '5', '420', '399', '113', '110', '111', '112', '381', '411', '348', '37', '13', '12', '14', '15', '9', '11', '10', '148', '168', '171', '172', '170', '173', '174', '175', '176', '177', '178', '179', '180', '181', '410', '182', '183', '184', '169', '185', '186', '187', '188', '189', '190', '191', '192', '52', '33', '36', '19', '34', '21', '28', '35', '32', '31', '29', '362', '27', '233', '30', '22', '23', '24', '25', '26', '20', '49', '161', '160', '157', '159', '166', '163', '158', '165', '164', '167', '162', '369', '370', '382', '383', '391', '385', '371', '365', '372', '386', '368', '135', '136', '295', '65', '46', '48', '56', '61', '45', '198', '199', '47', '60', '298', '297', '299', '58', '59', '149', '332', '340', '195', '196', '203', '204', '205', '206', '207', '208', '95', '214', '212', '337', '213', '209', '211', '210', '215', '216', '402', '217', '77', '218', '219', '220', '221', '313', '405', '338', '222', '223', '224', '288', '310', '225', '226', '227', '75', '228', '74', '93', '404', '350', '229', '94', '351', '230', '352', '400', '202', '312', '358', '359', '357', '360', '194', '193', '396', '154', '155', '156', '144', '145', '143', '319', '238', '315', '268', '274', '283', '272', '284', '285', '277', '269', '271', '273', '278', '375', '270', '267', '266', '279', '392', '264', '265', '275', '346', '301', '291', '329', '335', '336', '344', '330', '324', '334', '373', '134', '326', '327', '325', '292', '364', '401', '374', '403', '408', '413', '418', '419', '414', '415', '416', '417', '409', '316', '366', '367', '431', '432')) AND `glpi_softwarelicenses_4a402a7dd9d031ae77a0af53d4fa537b`.`is_template` = '0' AND ((`glpi_softwarelicenses_4a402a7dd9d031ae77a0af53d4fa537b`.`expire` IS NULL) OR (`glpi_softwarelicenses_4a402a7dd9d031ae77a0af53d4fa537b`.`expire` > NOW())) )LEFT JOIN `glpi_users`
ON (`glpi_softwares`.`users_id` = `glpi_users`.`id`
) WHERE `glpi_softwares`.`is_deleted` = 0 AND `glpi_softwares`.`is_template` = 0 AND ( `glpi_softwares`.`entities_id` IN ('0', '289', '63', '67', '318', '2', '79', '300', '116', '50', '323', '341', '422', '55', '345', '235', '379', '117', '287', '412', '7', '100', '331', '356', '84', '39', '322', '380', '69', '133', '53', '328', '76', '43', '384', '137', '354', '138', '62', '387', '339', '51', '390', '395', '355', '421', '333', '263', '363', '42', '428', '321', '234', '388', '81', '91', '377', '376', '378', '105', '83', '139', '430', '425', '140', '141', '18', '142', '146', '147', '236', '68', '103', '237', '239', '343', '314', '393', '407', '302', '427', '349', '8', '290', '342', '104', '57', '406', '429', '66', '102', '232', '101', '38', '85', '394', '17', '78', '361', '320', '80', '72', '423', '426', '240', '294', '71', '197', '293', '73', '54', '389', '424', '201', '286', '311', '200', '44', '92', '40', '3', '6', '4', '106', '107', '398', '114', '115', '108', '317', '109', '5', '420', '399', '113', '110', '111', '112', '381', '411', '348', '37', '13', '12', '14', '15', '9', '11', '10', '148', '168', '171', '172', '170', '173', '174', '175', '176', '177', '178', '179', '180', '181', '410', '182', '183', '184', '169', '185', '186', '187', '188', '189', '190', '191', '192', '52', '33', '36', '19', '34', '21', '28', '35', '32', '31', '29', '362', '27', '233', '30', '22', '23', '24', '25', '26', '20', '49', '161', '160', '157', '159', '166', '163', '158', '165', '164', '167', '162', '369', '370', '382', '383', '391', '385', '371', '365', '372', '386', '368', '135', '136', '295', '65', '46', '48', '56', '61', '45', '198', '199', '47', '60', '298', '297', '299', '58', '59', '149', '332', '340', '195', '196', '203', '204', '205', '206', '207', '208', '95', '214', '212', '337', '213', '209', '211', '210', '215', '216', '402', '217', '77', '218', '219', '220', '221', '313', '405', '338', '222', '223', '224', '288', '310', '225', '226', '227', '75', '228', '74', '93', '404', '350', '229', '94', '351', '230', '352', '400', '202', '312', '358', '359', '357', '360', '194', '193', '396', '154', '155', '156', '144', '145', '143', '319', '238', '315', '268', '274', '283', '272', '284', '285', '277', '269', '271', '273', '278', '375', '270', '267', '266', '279', '392', '264', '265', '275', '346', '301', '291', '329', '335', '336', '344', '330', '324', '334', '373', '134', '326', '327', '325', '292', '364', '401', '374', '403', '408', '413', '418', '419', '414', '415', '416', '417', '409', '316', '366', '367', '431', '432') ) AND ( ( (`glpi_softwares`.`name` LIKE '%ABC%' ) OR (`glpi_entities`.`completename` LIKE '%ABC%' ) OR (`glpi_manufacturers`.`name` LIKE '%ABC%' ) OR (`glpi_softwareversions`.`name` LIKE '%ABC%' ) OR (`glpi_operatingsystems_0a35c270152be19b5c8a485502badcd7`.`name` LIKE '%ABC%' ) OR (`glpi_softwarelicenses_4a402a7dd9d031ae77a0af53d4fa537b`.`serial` LIKE '%ABC%' ) OR (`glpi_softwarelicenses_4a402a7dd9d031ae77a0af53d4fa537b`.`otherserial` LIKE '%ABC%' ) OR (`glpi_softwarelicenses_4a402a7dd9d031ae77a0af53d4fa537b`.`name` LIKE '%ABC%' ) OR (((`glpi_users`.`realname` LIKE '%ABC%'
OR `glpi_users`.`firstname` LIKE '%ABC%'
OR `glpi_users`.`name` LIKE '%ABC%'
OR CONCAT(`glpi_users`.`realname`, ' ', `glpi_users`.`firstname`) LIKE '%ABC%' )
) )) ) GROUP BY `glpi_softwares`.`id` ORDER BY `id`
I've found a similar ticket with a pull request but I don't know if it can fix the problem we're having because an EXPLAIN gives me a different result
Optimize(Search): Handle LEFT JOIN which concern counting operatio lastly #16997
+------+-------------+--------------------------------------------------------------+--------+-----------------------------------------------------------------+---------------------+---------+---------------------------------------------------+--------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
| 1 | SIMPLE | glpi_softwares | index | is_template,entities_id,is_deleted | PRIMARY | 4 | NULL | 577274 | Using where |
| 1 | SIMPLE | glpi_entities | eq_ref | PRIMARY | PRIMARY | 4 | db_glpi.glpi_softwares.entities_id | 1 | |
| 1 | SIMPLE | glpi_manufacturers | eq_ref | PRIMARY | PRIMARY | 4 | db_glpi.glpi_softwares.manufacturers_id | 1 | |
| 1 | SIMPLE | glpi_softwareversions | ref | softwares_id | softwares_id | 4 | db_glpi.glpi_softwares.id | 6 | |
| 1 | SIMPLE | glpi_operatingsystems_0a35c270152be19b5c8a485502badcd7 | eq_ref | PRIMARY | PRIMARY | 4 | db_glpi.glpi_softwareversions.operatingsystems_id | 1 | Using where |
| 1 | SIMPLE | glpi_items_softwareversions_37010ce8f4633da91ded3e0a4c256dc9 | ref | softwareversions_id,is_deleted,is_deleted_item,is_template_item | softwareversions_id | 4 | db_glpi.glpi_softwareversions.id | 2 | Using where |
| 1 | SIMPLE | glpi_softwarelicenses_4a402a7dd9d031ae77a0af53d4fa537b | ref | is_template,expire,entities_id,softwares_id_expire_number | is_template | 1 | const | 1 | Using where |
| 1 | SIMPLE | glpi_users | eq_ref | PRIMARY | PRIMARY | 4 | db_glpi.glpi_softwares.users_id | 1 | Using where |
+------+-------------+--------------------------------------------------------------+--------+-----------------------------------------------------------------+---------------------+---------+---------------------------------------------------+--------+-------------+
8 rows in set (0,005 sec)
Thanks you for your help Richard
Relevant log output
Page URL
No response
Steps To reproduce
Search in Global search
Your GLPI setup information
Informations sur le système, l'installation et la configuration
GLPI 10.0.18 ( => /var/www/glpi) Installation mode: TARBALL Current language:fr_FR
Server
Operating system: Linux srv-glpi 6.1.0-31-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.128-1 (2025-02-07) x86_64 PHP 8.3.17 apache2handler (Core, FFI, PDO, Phar, Reflection, SPL, SimpleXML, Zend OPcache, apache2handler, bz2, calendar, ctype, curl, date, dom, exif, fileinfo, filter, ftp, gd, gettext, hash, iconv, igbinary, intl, json, ldap, libxml, mbstring, memcached, msgpack, mysqli, mysqlnd, openssl, pcre, pdo_mysql, posix, random, readline, session, shmop, sockets, sodium, standard, sysvmsg, sysvsem, sysvshm, tokenizer, xml, xmlreader, xmlwriter, xsl, zip, zlib) Setup: max_execution_time="30" memory_limit="128M" post_max_size="8M" safe_mode="" session.save_handler="files" upload_max_filesize="2M" disable_functions="" Software: Apache/2.4.62 (Debian) (Apache/2.4.62 (Debian) Server at gestparc.atemis.eu Port 80 ) Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36 Server Software: mariadb.org binary distribution Server Version: 11.7.2-MariaDB-deb12 Server SQL Mode: STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION Parameters: glpi_user@localhost/db_glpi Host info: Localhost via UNIX socketPHP version (8.3.17) is supported. Sessions configuration is OK. Allocated memory is sufficient. mysqli extension is installed. Following extensions are installed: dom, fileinfo, filter, libxml, json, simplexml, xmlreader, xmlwriter. curl extension is installed. gd extension is installed. intl extension is installed. zlib extension is installed. The constant SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NPUBBYTES is present. Database engine version (11.7.2) is supported. No files from previous GLPI version detected. The log file has been created successfully. Write access to /var/www/glpi/files/_cache has been validated. Write access to /var/www/glpi/files/_cron has been validated. Write access to /var/www/glpi/files has been validated. Write access to /var/www/glpi/files/_dumps has been validated. Write access to /var/www/glpi/files/_graphs has been validated. Write access to /var/www/glpi/files/_lock has been validated. Write access to /var/www/glpi/files/_pictures has been validated. Write access to /var/www/glpi/files/_plugins has been validated. Write access to /var/www/glpi/files/_rss has been validated. Write access to /var/www/glpi/files/_sessions has been validated. Write access to /var/www/glpi/files/_tmp has been validated. Write access to /var/www/glpi/files/_uploads has been validated.
Web server root directory configuration seems safe. Sessions configuration is secured. OS and PHP are relying on 64 bits integers. exif extension is installed. ldap extension is installed. openssl extension is installed. Following extensions are installed: bz2, Phar, zip. Zend OPcache extension is installed. Following extensions are installed: ctype, iconv, mbstring, sodium. Write access to /var/www/glpi/marketplace has been validated. Timezones seems loaded in database.
GLPI constants
GLPI_ROOT: "/var/www/glpi" GLPI_CONFIG_DIR: "/var/www/glpi/config" GLPI_VAR_DIR: "/var/www/glpi/files" GLPI_MARKETPLACE_DIR: "/var/www/glpi/marketplace" GLPI_USE_CSRF_CHECK: "1" GLPI_CSRF_EXPIRES: "7200" GLPI_CSRF_MAX_TOKENS: "100" GLPI_USE_IDOR_CHECK: "1" GLPI_IDOR_EXPIRES: "7200" GLPI_ALLOW_IFRAME_IN_RICH_TEXT: false GLPI_SERVERSIDE_URL_ALLOWLIST: ["#^http://[^@:]+(:80)?(/.)?$#","#^https://[^@:]+(:443)?(/.)?$#","#^feed://[^@:]+(/.)?$#"] GLPI_DISALLOWED_UPLOADS_PATTERN: "/\.(php\d|phar)$/i" GLPI_TELEMETRY_URI: "https://telemetry.glpi-project.org" GLPI_INSTALL_MODE: "TARBALL" GLPI_NETWORK_MAIL: "[email protected]" GLPI_NETWORK_SERVICES: "https://services.glpi-network.com" GLPI_MARKETPLACE_ALLOW_OVERRIDE: true GLPI_MARKETPLACE_MANUAL_DOWNLOADS: true GLPI_USER_AGENT_EXTRA_COMMENTS: "" GLPI_DISABLE_ONLY_FULL_GROUP_BY_SQL_MODE: "1" GLPI_AJAX_DASHBOARD: "1" GLPI_CALDAV_IMPORT_STATE: 0 GLPI_DEMO_MODE: "0" GLPI_CENTRAL_WARNINGS: "1" GLPI_TEXT_MAXSIZE: "4000" GLPI_DOC_DIR: "/var/www/glpi/files" GLPI_CACHE_DIR: "/var/www/glpi/files/_cache" GLPI_CRON_DIR: "/var/www/glpi/files/_cron" GLPI_DUMP_DIR: "/var/www/glpi/files/_dumps" GLPI_GRAPH_DIR: "/var/www/glpi/files/_graphs" GLPI_LOCAL_I18N_DIR: "/var/www/glpi/files/_locales" GLPI_LOCK_DIR: "/var/www/glpi/files/_lock" GLPI_LOG_DIR: "/var/www/glpi/files/_log" GLPI_PICTURE_DIR: "/var/www/glpi/files/_pictures" GLPI_PLUGIN_DOC_DIR: "/var/www/glpi/files/_plugins" GLPI_RSS_DIR: "/var/www/glpi/files/_rss" GLPI_SESSION_DIR: "/var/www/glpi/files/_sessions" GLPI_TMP_DIR: "/var/www/glpi/files/_tmp" GLPI_UPLOAD_DIR: "/var/www/glpi/files/_uploads" GLPI_INVENTORY_DIR: "/var/www/glpi/files/_inventories" GLPI_NETWORK_REGISTRATION_API_URL: "https://services.glpi-network.com/api/registration/" GLPI_MARKETPLACE_PLUGINS_API_URI: "https://services.glpi-network.com/api/marketplace/" GLPI_I18N_DIR: "/var/www/glpi/locales" GLPI_VERSION: "10.0.18" GLPI_SCHEMA_VERSION: "10.0.18@d64066799f068b16ee973b377bdd13f984fe062a" GLPI_MARKETPLACE_PRERELEASES: false GLPI_MIN_PHP: "7.4.0" GLPI_MAX_PHP: "8.4.0" GLPI_YEAR: "2025"
Libraries
htmlawed/htmlawed version 1.2.14 in (/var/www/glpi/vendor/htmlawed/htmlawed) phpmailer/phpmailer version 6.8.0 in (/var/www/glpi/vendor/phpmailer/phpmailer/src) simplepie/simplepie version 1.5.8 in (/var/www/glpi/vendor/simplepie/simplepie/library) tecnickcom/tcpdf version 6.8.0 in (/var/www/glpi/vendor/tecnickcom/tcpdf) michelf/php-markdown in (/var/www/glpi/vendor/michelf/php-markdown/Michelf) true/punycode in (/var/www/glpi/vendor/true/punycode/src) iamcal/lib_autolink in (/var/www/glpi/vendor/iamcal/lib_autolink) sabre/dav in (/var/www/glpi/vendor/sabre/dav/lib/DAV) sabre/http in (/var/www/glpi/vendor/sabre/http/lib) sabre/uri in (/var/www/glpi/vendor/sabre/uri/lib) sabre/vobject in (/var/www/glpi/vendor/sabre/vobject/lib) laminas/laminas-i18n in (/var/www/glpi/vendor/laminas/laminas-i18n/src) laminas/laminas-servicemanager in (/var/www/glpi/vendor/laminas/laminas-servicemanager/src) monolog/monolog in (/var/www/glpi/vendor/monolog/monolog/src/Monolog) sebastian/diff in (/var/www/glpi/vendor/sebastian/diff/src) donatj/phpuseragentparser in (/var/www/glpi/vendor/donatj/phpuseragentparser/src/UserAgent) elvanto/litemoji in (/var/www/glpi/vendor/elvanto/litemoji/src) symfony/console in (/var/www/glpi/vendor/symfony/console) scssphp/scssphp in (/var/www/glpi/vendor/scssphp/scssphp/src) laminas/laminas-mail in (/var/www/glpi/vendor/laminas/laminas-mail/src/Protocol) laminas/laminas-mime in (/var/www/glpi/vendor/laminas/laminas-mime/src) rlanvin/php-rrule in (/var/www/glpi/vendor/rlanvin/php-rrule/src) ramsey/uuid in (/var/www/glpi/vendor/ramsey/uuid/src) psr/log in (/var/www/glpi/vendor/psr/log/Psr/Log) psr/simple-cache in (/var/www/glpi/vendor/psr/simple-cache/src) psr/cache in (/var/www/glpi/vendor/psr/cache/src) league/csv in (/var/www/glpi/vendor/league/csv/src) mexitek/phpcolors in (/var/www/glpi/vendor/mexitek/phpcolors/src/Mexitek/PHPColors) guzzlehttp/guzzle in (/var/www/glpi/vendor/guzzlehttp/guzzle/src) guzzlehttp/psr7 in (/var/www/glpi/vendor/guzzlehttp/psr7/src) glpi-project/inventory_format in (/var/www/glpi/vendor/glpi-project/inventory_format/lib/php) wapmorgan/unified-archive in (/var/www/glpi/vendor/wapmorgan/unified-archive/src) paragonie/sodium_compat in (/var/www/glpi/vendor/paragonie/sodium_compat/src) symfony/cache in (/var/www/glpi/vendor/symfony/cache) html2text/html2text in (/var/www/glpi/vendor/html2text/html2text/src) symfony/css-selector in (/var/www/glpi/vendor/symfony/css-selector) symfony/dom-crawler in (/var/www/glpi/vendor/symfony/dom-crawler) twig/twig in (/var/www/glpi/vendor/twig/twig/src) twig/string-extra in (/var/www/glpi/vendor/twig/string-extra) symfony/polyfill-ctype not found symfony/polyfill-iconv not found symfony/polyfill-mbstring not found symfony/polyfill-php80 not found symfony/polyfill-php81 not found symfony/polyfill-php82 in (/var/www/glpi/vendor/symfony/polyfill-php82) league/oauth2-client in (/var/www/glpi/vendor/league/oauth2-client/src/Provider) league/oauth2-google in (/var/www/glpi/vendor/league/oauth2-google/src/Provider) thenetworg/oauth2-azure in (/var/www/glpi/vendor/thenetworg/oauth2-azure/src/Provider) phpCas version 1.6.0 in (/usr/share/php/CAS/source)
LDAP directories
Server: '', Port: '389', ***', Connection filter: '))', RootDN: '***', Use TLS: none
SQL replicas
Not active
Notifications
Way of sending emails: PHP
Plugins list
glpiinventory Name: GLPI Inventory Version: 1.5.3 State: Enabled
Install Method: Manual
Anything else?
No response
Most of the time, that kind of issue is caused by a default view in one of the asset types with too much columns, or columns that implies complex queries. Try to review default views, that may solve your issue.
Thank you very much, I've modified the global view and it does indeed give a faster result. It looks like it's the Versions columns that are slowing down the query.
Nom, Entité, Sous-entité, Versions - Nom, Versions - Système d'exploitation : (/front/search.php duration : 67404 ms)
Nom, Entité, Sous-entité, Versions - Nom : (/front/search.php duration : 72373 ms)
Nom, Entité, Versions - Nom : (/front/search.php duration : 69951 ms)
Nom, Entité, Sous-entité, Editeur : (/front/search.php duration : 5707 ms)
Nom, Entité, Sous-entité, Editeur, Nombre d'installations : (/front/search.php duration : 5669 ms)
Global search is probably always going to be slow on a well-used GLPI instance in the current state. Three solutions I see to the overall issue:
- Load the results page immediately but load the search for each individual itemtype asynchronously. This way, no single itemtype can block the other results.
- Add a configuration parameter to allow GLPI admins to restrict the global search types more than
$CFG_GLPI['globalsearch_types']. If the admin never wants to include Software, there is no need to waste resources searching it. - Add a new display preference type (Like we did for Helpdesk views) that is specific to global search. If a GLPI admin knows they are always going to need to search in the name and serial number only, there is no need to search other columns.