Skip to main content

Partition count per projections and per table

  • June 2, 2016
  • 3 replies
  • 25 views

Rajzz
Forum|alt.badge.img+1
  • Participating Frequently

How to get count of partitions are there per projections and also per table? Just wanted to have a track of partitions count as a maintanance activity.

3 replies

Rahul_Choudhary
Forum|alt.badge.img
  • Participating Frequently
  • June 2, 2016

Hi 

 

You can use partitions table to get this info. Please see below query as an example which demonstrate the same:

 

 

rchoudhary=> select node_name,table_schema,projection_name,count(distinct(partition_key)) partitions from partitions group by 1,2,3 order by 3 desc;
node_name | table_schema | projection_name | partitions
------------------------+--------------+-----------------+------------
v_scrutinload_node0002 | public | p_test_b1 | 1
v_scrutinload_node0003 | public | p_test_b1 | 1
v_scrutinload_node0001 | public | p_test_b1 | 1
v_scrutinload_node0002 | public | p_test_b0 | 2
v_scrutinload_node0001 | public | p_test_b0 | 2
v_scrutinload_node0003 | public | p_test_b0 | 2
v_scrutinload_node0002 | public | p_b1 | 1
v_scrutinload_node0001 | public | p_b0 | 1
(8 rows)

 

I hope it helps!!

 

Regards

Rahul

 


Rajzz
Forum|alt.badge.img+1
  • Author
  • Participating Frequently
  • June 3, 2016

it works. Thanks Rahul


Rahul_Choudhary
Forum|alt.badge.img
  • Participating Frequently
  • June 3, 2016

Pleasure is all mine :-)

 

Enjoy your day!!

 

Regards

Rahul