Issue Task Resolved

#110513Improve LinkValidator record lookup performance with composite indexes

Wouter Wolters 08/21/26, 20:51 updated 09/04/26, 12:20

Description

The tx_linkvalidator_link table is queried repeatedly using these field combinations:

- record_uid and table_name
- record_pid and table_name

Without matching indexes, these queries require full table scans and become slower as the broken-link table grows.

Add the following composite indexes:

KEY record_uid_table (record_uid,table_name)
KEY record_pid_table (record_pid,table_name)

A synthetic SQLite benchmark with 100,000 rows measured:

- Record UID lookup: 2.273 ms → 0.010 ms (217× faster)
- Record PID lookup: 2.278 ms → 0.012 ms (191× faster)

These figures demonstrate the improvement to the indexed predicates; actual end-to-end LinkValidator performance also depends on joins, permission checks, and result processing.

Reviews 3

History 15

  1. Wouter Wolters commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-09-04T12:20:09+00:00" > 09/04/26, 12:20 </span>

    Applied in changeset commit:9892c9c896199ab8cf784bb18c2f41406010023e.