Skip to content

Instantly share code, notes, and snippets.

@vitroz
Last active August 31, 2022 20:59

Revisions

  1. vitroz revised this gist Aug 31, 2022. 1 changed file with 6 additions and 1 deletion.
    7 changes: 6 additions & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -18,7 +18,12 @@ 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)
  2. vitroz created this gist Aug 31, 2022.
    45 changes: 45 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,45 @@
    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



    /////

    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