diff --git a/src/db/roomstore.ts b/src/db/roomstore.ts
index e8e66f4df880b1b09241a7c2f5213c20a8e0c18a..8a5965017ae4b4b4ff4581ad5d73ce374fa82840 100644
--- a/src/db/roomstore.ts
+++ b/src/db/roomstore.ts
@@ -104,7 +104,7 @@ export class DbRoomStore {
      * @returns {number} The amount of room pairs as an integer
      */
     public async countEntries() {
-        const row = (await this.db.Get("SELECT COUNT(*) FROM room_entries")) || {};
+        const row = (await this.db.Get("SELECT COUNT(*) FROM room_entries WHERE matrix_id IS NOT NULL AND remote_id IS NOT NULL")) || {};
 
         if (typeof row.count !== "number") {
             log.error("Failed to count room entries");