Issue #3493290: Batch-load existing links in MenuTreeStorage::rebuild()
Pre-load all existing menu links at the start of rebuild() instead of querying for each link individually in doSave(). This reduces database queries from N (one per link) to 1 (single IN query).
Changes:
- Add $preloadedOriginals property to cache batch-loaded data
- Load all existing links matching definition IDs at rebuild() start
- Use cached data in doSave() when available
- Update cache after successful inserts to prevent duplicate key errors
- Fall back to per-link query for links not in definitions (purgeMultiple)
- Clear cache at end of rebuild()
Performance improvement on YMCA Website Services site-install:
- safeExecuteSelect calls: 230,127 -> 113,787 (-50%)
- MenuLinkManager::rebuild time: 49.57s -> 22.06s (-56%)
- Total install time: 180s -> 152s (-15%) See stats https://github.com/YCloudYUSA/yusaopeny-project/pull/63#issuecomment-3714625772 with logs
Closes #3493290