@@ -345,30 +345,29 @@ impl Layout {
345
345
346
346
/// Remove all data from the underlying deployment that is not needed to
347
347
/// respond to queries before block `earliest_block`. The `req` is used
348
- /// to determine which strategy should be used for pruning, copy or
348
+ /// to determine which strategy should be used for pruning, rebuild or
349
349
/// delete.
350
350
///
351
351
/// Blocks before `req.final_block` are considered final and it is
352
352
/// assumed that they will not be modified in any way while pruning is
353
353
/// running.
354
354
///
355
- /// The copy strategy implemented here works well for situations in
355
+ /// The rebuild strategy implemented here works well for situations in
356
356
/// which pruning will remove a large amount of data from the subgraph
357
357
/// (say, at least 50%)
358
358
///
359
- /// The strategy for `prune_by_copying` is to copy all data that is
360
- /// needed to respond to queries at block heights at or after
361
- /// `earliest_block` to a new table and then to replace the existing
362
- /// tables with these new tables atomically in a transaction. Copying
363
- /// happens in two stages that are performed for each table in turn: we
364
- /// first copy data for final blocks without blocking writes, and then
365
- /// copy data for nonfinal blocks. The latter blocks writes by taking a
366
- /// lock on the row for the deployment in `subgraph_deployment` (via
367
- /// `deployment::lock`) The process for switching to the new tables
368
- /// needs to take the naming of various database objects that Postgres
369
- /// creates automatically into account so that they all have the same
370
- /// names as the original objects to ensure that pruning can be done
371
- /// again without risking name clashes.
359
+ /// The strategy for rebuilding is to copy all data that is needed to
360
+ /// respond to queries at block heights at or after `earliest_block` to
361
+ /// a new table and then to replace the existing tables with these new
362
+ /// tables atomically in a transaction. Rebuilding happens in two stages
363
+ /// that are performed for each table in turn: we first copy data for
364
+ /// final blocks without blocking writes, and then copy data for
365
+ /// nonfinal blocks. The latter blocks writes by taking an advisory lock
366
+ /// on the deployment (via `deployment::lock`) The process for switching
367
+ /// to the new tables needs to take the naming of various database
368
+ /// objects that Postgres creates automatically into account so that
369
+ /// they all have the same names as the original objects to ensure that
370
+ /// pruning can be done again without risking name clashes.
372
371
///
373
372
/// The reason this strategy works well when a lot (or even the
374
373
/// majority) of the data needs to be removed is that in the more
@@ -380,8 +379,8 @@ impl Layout {
380
379
/// tables. But a full vacuum takes an `access exclusive` lock which
381
380
/// prevents both reads and writes to the table, which means it would
382
381
/// also block queries to the deployment, often for extended periods of
383
- /// time. The `prune_by_copying` strategy never blocks reads, it only
384
- /// ever blocks writes.
382
+ /// time. The rebuild strategy never blocks reads, it only ever blocks
383
+ /// writes.
385
384
pub fn prune (
386
385
& self ,
387
386
logger : & Logger ,
0 commit comments