Skip to content

Instantly share code, notes, and snippets.

@vitroz
Last active August 31, 2022 20:59
Show Gist options
  • Save vitroz/120f72c401094765db4422bf6ba397f9 to your computer and use it in GitHub Desktop.
Save vitroz/120f72c401094765db4422bf6ba397f9 to your computer and use it in GitHub Desktop.
bronto_records_to_delete
table | # of records
app_listings -> #1 (check)
new_integrations -> #163 (check)
webhooks -> #27
webhook_event_definitions_webhooks -> # 27
trackable_tasks (associated to bronto webhooks) -> # 752
trackable_tasks (associated to bronto new integrations) -> # 64
trackable_tasks type = 'TrackableTask::BrontoSyncBulk' -> #21
trackable_tasks type = 'TrackableTask::BrontoWebhookInitialSync' -> #27
trackable_tasks type = 'TrackableTask::BrontoWebhookSetup' -> # 33
connected_accounts -> # 21
integration_events (app_slug = 'bronto') -> # 257
///// count queries //////
select * from app_listings where app_id = 11 --// 1 (check)
select * from new_integrations where app_id = 11 --// # 163 (check)
select count(*) from webhooks where app_id = 11 --// # 27
select count(we.*) from webhook_event_definitions_webhooks we
join webhooks w on w.id = we.webhook_id
where w.app_id = 11 --// # 27
select count(we.*) from trackable_tasks we
join webhooks w on w.id = we.owner_webhook_id
where w.app_id = 11 --// # 752
select count(t.*) from trackable_tasks t
join new_integrations n on n.id = t.owner_integration_id
where n.type = 'NewIntegration::BrontoNewIntegration' --// # 64
select count(*) from trackable_tasks where type = 'TrackableTask::BrontoSyncBulk' --// #21
select count(*) from trackable_tasks where type = 'TrackableTask::BrontoWebhookInitialSync' --// #27
select count(*) from trackable_tasks where type = 'TrackableTask::BrontoWebhookSetup' --// # 33
select * from connected_accounts where type = 'ConnectedAccount::BrontoConnectedAccount' --// # 21
select count(*) from integration_events where app_slug = 'bronto' --// # 257
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment