diff --git a/content/en/hosting/analytics/building-dbt-models.md b/content/en/hosting/analytics/building-dbt-models.md index e56985d3c..a72f181cf 100644 --- a/content/en/hosting/analytics/building-dbt-models.md +++ b/content/en/hosting/analytics/building-dbt-models.md @@ -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.