Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Field Add Index

Security covered Under active development 5 sites

This module adds database indexes to certain custom field types (text, string, and their variations) to improve the performance of searching and filtering content in views. Without these indexes, views that use these fields as search criteria can result in slow queries due to full table scans.

Drupal custom fields do not add indexes to field values by default. This will cause a problem. When you expose this field as a search field in views, the execution will scan the entire table. The performance will be very slow.

You can use the following to test

EXPLAIN SELECT * FROM `node__body` WHERE body_value LIKE "hello"

You can see that the number of rows is the total number. This is because MySQL will perform a full table scan for non-indexed table searches.

Features

Index Support

  1. text
  2. text_long
  3. text_with_summary
  4. string
  5. string_long

How to use

  1. go to /admin/structure/types/manage/yourtypes/fields
  2. edit field and chose Add Index
  3. save and run drush entity-updates (https://www.drupal.org/project/devel_entity_updates)
Drupal 10–11 PHP ^7 || ^8.0

Ask your assistant about Field Add Index

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
3
Tracked since
Aug 2024
Latest release
2 years ago
Releases (12 mo)
0
Maintenance
Dormant

Release Timeline

Releases

Version Type Core PHP Release date
1.0.2 Stable 10–11 PHP ^7 || ^8.0 Aug 23, 2024
1.0.1 Stable 10–11 PHP ^7 Aug 15, 2024
1.0.x-dev Dev 10–11 PHP ^7 || ^8.0 Aug 15, 2024