You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This change makes PHP replacement queries and memory usage more
efficient.
It improves the primary key SELECT queries by eliminating the use of
OFFSET because OFFSET requires that the database consider all rows up to
OFFSET before taking rows up to the LIMIT. The new query relies on
primary key conditions to more efficiently eliminate previous rows from
consideration. This way, the database can use an index to identify rows
with keys greater than those of the previous chunk.
It improves memory usage by doing updates along the way rather than
storing all a column's updates in memory until the end. At Automattic,
when we limit search-replace to 4GB of memory, we sometimes exceed that
limit for large sites. It's possible there are other things that
contribute to high memory usage within the search-replace command, but
as a first step, we can reduce memory requirements by no longer keeping
all updated column values in memory simultaneously.
0 commit comments