Problem/Motivation
Currently the drush whatlinkshere:scan command only scans nodes, and it does so by loading all of the site's node IDs into a batch service that then processes the nodes individually, considering whether or not to process each field on each node one at a time, which is very inefficient for large sites.
Proposed resolution
Rewrite the scan command so that for each supported entity type, it considers each of the fields, and if a field is in the types_of_interest, batches the field table to be processed all at once, querying for links in the field values without loading the individual node entities. For example, the node__body table would be queried for links, but a date field on nodes would be skipped because it can never contain links.
Remaining tasks
Write a new batch service that processes field tables instead of nodes. Rewrite the scan command to determine which field tables need to be processed (and how: entity_reference, text, or link?) and put them in the batch.
User interface changes
Replace the --nid=node_id parameter with --type=entity_type and --id=entity_id.
Issue fork whatlinkshere-3213705
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
benstallings commentedComment #5
johan.gant commentedA long time coming, but there's a MR pending which fixes the poor batch handling of the module's scan command. If I get enough time to do it I'll look at extending it further to make it configurable to scan specific entity types as well.
https://git.drupalcode.org/project/whatlinkshere/-/merge_requests/9
Comment #6
johan.gant commentedChanges merged into 2.x with 4f9ee865.