flipsidecryptoKSM Query Run Count
    Updated 2023-10-16

    with compass_runs as (
    select
    qr.id,
    qr.user_id,
    qr.STARTED_AT,
    qr.QUERY_RUNNING_ENDED_AT,
    datediff(seconds,qr.STARTED_AT,qr.QUERY_RUNNING_ENDED_AT) as diff
    from BI_ANALYTICS.COMPASS_PROD.QUERY_RUNS qr
    where qr.query_running_ended_at is not null
    ),
    sources as (
    select
    'compass' as source,
    count(distinct id) as query_runs
    from compass_runs
    union
    select
    'velocity' as source,
    count(distinct id) as query_runs
    from bi_analytics.velocity_app_prod.query_runs
    union
    select
    'shroomdk' as source,
    '3320625'::integer as query_runs

    -- removed to avoid permissions issue, number shouldnt change anyway:
    -- select 'shroomdk' as source, count(*) as query_runs
    -- from BI_ANALYTICS.SHROOMDK.SDK_QUERIES
    )

    select sum(query_runs) from sources


    Run a query to Download Data