Options

Top 10 Re-fetches in Depot

Hi,

The MC has a great utility for determine that top 10 tables with the most refetches in a given period:
Top 10 Re-fetches in Depot

How can I get the same list with a query?
Thanks for any pointers!

Tagged:

Best Answer

  • Options
    Jim_KnicelyJim_Knicely - Select Field - Administrator
    Answer ✓

    Should be this one:

    SELECT COUNT(*) AS refetches,
           pr.projection_schema AS table_schema,
           pr.anchor_table_name AS table_name
      FROM v_internal.dc_depot_fetches f
      JOIN storage_containers s 
        ON s.sal_storage_id = f.storageid
      JOIN projections pr
        ON pr.projection_id = s.projection_id
     WHERE time > to_timestamp_tz({from_time}) AND time <= to_timestamp_tz({to_time})
     GROUP BY 2,3
    HAVING COUNT(*) > 1
     ORDER BY refetches, pr.projection_schema, pr.anchor_table_name DESC
     LIMIT 10;
    

Answers

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file