diff --git a/src/database/sql/bundles/repair.sql b/src/database/sql/bundles/repair.sql
index afed8869..03bf8bf4 100644
--- a/src/database/sql/bundles/repair.sql
+++ b/src/database/sql/bundles/repair.sql
@@ -22,7 +22,6 @@ FROM (
   ORDER BY b.import_attempt_count, b.last_queued_at ASC
   LIMIT @limit
 )
-ORDER BY RANDOM()
 
 -- updateFullyIndexedAt
 UPDATE bundles
diff --git a/src/database/standalone-sqlite.ts b/src/database/standalone-sqlite.ts
index c82656d6..6ba0de02 100644
--- a/src/database/standalone-sqlite.ts
+++ b/src/database/standalone-sqlite.ts
@@ -812,14 +812,16 @@ export class StandaloneSqliteDatabaseWorker {
   getFailedBundleIds(limit: number) {
     const reprocessCutoff = currentUnixTimestamp() - BUNDLE_REPROCESS_WAIT_SECS;
 
+    const rows = this.stmts.bundles.selectFailedBundleIds.all({
+      limit,
+      reprocess_cutoff: reprocessCutoff,
+    });
+
     this.log.debug('getFailedBundleIds', {
       reprocessCutoff,
       BUNDLE_REPROCESS_WAIT_SECS,
-    });
-
-    const rows = this.stmts.bundles.selectFailedBundleIds.all({
       limit,
-      reprocess_cutoff: reprocessCutoff,
+      rowsLength: rows.length,
     });
 
     return rows.map((row): string => toB64Url(row.id));
diff --git a/src/workers/bundle-repair-worker.ts b/src/workers/bundle-repair-worker.ts
index 2ae4e22c..d0469b44 100644
--- a/src/workers/bundle-repair-worker.ts
+++ b/src/workers/bundle-repair-worker.ts
@@ -107,6 +107,7 @@ export class BundleRepairWorker {
       );
 
       this.log.debug('Bundles to retry', {
+        idsLength: bundleIds.length,
         bundleIds,
         batchSize: config.BUNDLE_REPAIR_RETRY_BATCH_SIZE,
       });