diff --git a/core/lib/dal/.sqlx/query-3fce4cdef286a18aab88bbe11bec216ea6336b859ad8093b64463426f7a6df37.json b/core/lib/dal/.sqlx/query-3fce4cdef286a18aab88bbe11bec216ea6336b859ad8093b64463426f7a6df37.json deleted file mode 100644 index 8fb092873427..000000000000 --- a/core/lib/dal/.sqlx/query-3fce4cdef286a18aab88bbe11bec216ea6336b859ad8093b64463426f7a6df37.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "db_name": "PostgreSQL", - "query": "\n VACUUM FREEZE l1_batches,\n miniblocks,\n storage_logs,\n events,\n call_traces,\n l2_to_l1_logs,\n transactions\n ", - "describe": { - "columns": [], - "parameters": { - "Left": [] - }, - "nullable": [] - }, - "hash": "3fce4cdef286a18aab88bbe11bec216ea6336b859ad8093b64463426f7a6df37" -} diff --git a/core/lib/dal/src/pruning_dal/mod.rs b/core/lib/dal/src/pruning_dal/mod.rs index 09c16e147d23..9a5356202aee 100644 --- a/core/lib/dal/src/pruning_dal/mod.rs +++ b/core/lib/dal/src/pruning_dal/mod.rs @@ -443,25 +443,4 @@ impl PruningDal<'_, '_> { .await?; Ok(()) } - - // This method must be separate as VACUUM is not supported inside a transaction - pub async fn run_vacuum_after_hard_pruning(&mut self) -> DalResult<()> { - sqlx::query!( - r#" - VACUUM FREEZE l1_batches, - miniblocks, - storage_logs, - events, - call_traces, - l2_to_l1_logs, - transactions - "#, - ) - .instrument("hard_prune_batches_range#vacuum") - .report_latency() - .execute(self.storage) - .await?; - - Ok(()) - } } diff --git a/core/node/db_pruner/src/lib.rs b/core/node/db_pruner/src/lib.rs index e2a9251b47a6..25747102275d 100644 --- a/core/node/db_pruner/src/lib.rs +++ b/core/node/db_pruner/src/lib.rs @@ -5,7 +5,7 @@ use std::{fmt, sync::Arc, time::Duration}; use anyhow::Context as _; use async_trait::async_trait; use serde::Serialize; -use tokio::{sync::watch, time::Instant}; +use tokio::sync::watch; use zksync_dal::{pruning_dal::PruningInfo, Connection, ConnectionPool, Core, CoreDal}; use zksync_health_check::{Health, HealthStatus, HealthUpdater, ReactiveHealthCheck}; use zksync_types::{L1BatchNumber, L2BlockNumber}; @@ -272,7 +272,6 @@ impl DbPruner { .collect::>() ); - let mut last_vacuum_time = Instant::now(); while !*stop_receiver.borrow_and_update() { if let Err(err) = self.update_l1_batches_metric().await { tracing::warn!("Error updating DB pruning metrics: {err:?}"); @@ -294,15 +293,6 @@ impl DbPruner { Ok(pruning_done) => !pruning_done, }; - if Instant::now().duration_since(last_vacuum_time) > Duration::from_secs(24 * 3600) { - let mut storage = self.connection_pool.connection_tagged("db_pruner").await?; - storage - .pruning_dal() - .run_vacuum_after_hard_pruning() - .await?; - last_vacuum_time = Instant::now(); - } - if should_sleep && tokio::time::timeout(next_iteration_delay, stop_receiver.changed()) .await