Skip to content

Commit

Permalink
chore: update SQL query
Browse files Browse the repository at this point in the history
  • Loading branch information
njuguna-n committed Nov 6, 2024
1 parent d338c77 commit 22e3c34
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion content/en/hosting/analytics/building-dbt-models.md
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ kubectl exec -it postgres-pod-name -- psql -U postgres -c "SELECT pg_size_pretty

To get the percentage of documents that have synced you can run the following query in your Postgres database:
```sql
select (count(*) * 100 / (count(*) + (select sum(pending) from v1.couchdb_progress))) as sync_percentage from v1.medic;
SELECT (COUNT(*) * 100 / (COUNT(*) + (SELECT SUM(pending) FROM v1.couchdb_progress))) AS sync_percentage FROM v1.medic;
```

This query selects the total number of documents that have been synced to the `v1.medic` table and divides it by the total number of documents that have been synced and the number of documents that are pending to be synced. This will give you the percentage of documents that have been synced. Update the table names to match the names of the tables in your database making sure to update the schema name as well. Run this query periodically to monitor the progress of the sync and stop the sync process once you get to the desired percentage. It's okay if it is not exactly 10% as long as it is close enough to give you an idea of the disk space required.
Expand Down

0 comments on commit 22e3c34

Please sign in to comment.