- out of my latest incident analyses came a bunch of new queries.
Signed-off-by: Andreas Gerler <baronNOSPAMbundesbrandschatzamt.de>
--- /dev/null
+# -*- mode: snippet -*-
+# name: errors
+# key: errors_
+# --
+SELECT DISTINCT error_level, message FROM error_messages $0WHERE message ILIKE 'Vertica suggests%';
--- /dev/null
+# -*- mode: snippet -*-
+# name: get-partitions
+# key: get-part
+# --
+SELECT * FROM v_monitor.partitions WHERE table_schema = '$1' AND projection_name LIKE '%$2%';$0
\ No newline at end of file
--- /dev/null
+# -*- mode: snippet -*-
+# name: get-projections
+# key: get-proj
+# --
+SELECT GET_PROJECTIONS('$1');$0
\ No newline at end of file
--- /dev/null
+# -*- mode: snippet -*-
+# name: rebalance_status
+# key: rebalance_status_
+# --
+SELECT rebalance_method rebalance_method,
+ status,
+ count(*) AS COUNT
+FROM
+ (SELECT rebalance_method,
+ CASE
+ WHEN (separated_percent = 100
+ AND transferred_percent = 100) THEN 'Completed'
+ WHEN (separated_percent <> 0
+ AND separated_percent <> 100)
+ OR (transferred_percent <> 0
+ AND transferred_percent <> 100) THEN 'In Progress'
+ ELSE 'Queued'
+ END AS status
+ FROM rebalance_projection_status
+ WHERE is_latest) AS tab
+GROUP BY 1,
+ 2
+ORDER BY 1,
+ 2;$0
--- /dev/null
+# -*- mode: snippet -*-
+# name: resource-pool-move
+# key: rpmv
+# --
+SELECT * FROM resource_pool_move ORDER BY move_timestamp DESC LIMIT 40;$0
\ No newline at end of file
--- /dev/null
+# -*- mode: snippet -*-
+# name: sessions
+# key: sess_
+# --
+SELECT * FROM sessions;$0
\ No newline at end of file
--- /dev/null
+# -*- mode: snippet -*-
+# name: storage-containers
+# key: storage-containers
+# --
+SELECT s.node_name,
+ p.table_schema,
+ s.projection_name,
+ count(DISTINCT s.storage_oid) storage_container_count,
+ count(DISTINCT partition_key) partition_count,
+ count(r.rosid) ros_file_count
+FROM storage_containers s
+LEFT OUTER JOIN partitions p ON s.storage_oid = p.ros_id
+JOIN vs_ros r ON r.delid = s.storage_oid
+GROUP BY 1,
+ 2,
+ 3
+ORDER BY 4 DESC LIMIT 50;$0
\ No newline at end of file
--- /dev/null
+# -*- mode: snippet -*-
+# name: user_sessions
+# key: ussess_
+# --
+SELECT session_id, transaction_start FROM sessions WHERE user_name = '$1' ORDER BY 2 desc;$0
\ No newline at end of file