Skip to main content
Question

Different ways of measuring catalog size?

  • January 14, 2019
  • 5 replies
  • 16 views

Bryan_H
Forum|alt.badge.img+2

Hi, I am trying to help a customer with apparent catalog and TM issues, but seems we see very different counts depending on which query we run. Any thoughts on why these two queries give such different returns:

dwvdbprod1=> SELECT node_name, MAX (ts) AS ts, to_char(MAX(catalog_size_in_MB)::int,'999,999') AS catlog_size_in_MB
dwvdbprod1-> FROM
dwvdbprod1-> (SELECT node_name, TRUNC((a."time")::TIMESTAMP, 'SS'::VARCHAR(2)) AS ts, SUM((a.total_memory_max_value - a.free_memory_min_value))/(1024*1024) AS catalog_size_in_MB
dwvdbprod1(> from dc_allocation_pool_statistics_by_second a GROUP BY 1, TRUNC((a."time")::TIMESTAMP, 'SS'::VARCHAR(2))
dwvdbprod1(> )
dwvdbprod1-> subquery_1 GROUP BY 1 ORDER BY 1 LIMIT 50; !date
node_name | ts | catlog_size_in_MB
-----------------------+---------------------+-------------------
v_dwvdbprod1_node0001 | 2019-01-14 00:09:16 | 3,782
v_dwvdbprod1_node0002 | 2019-01-14 00:09:16 | 4,316
v_dwvdbprod1_node0003 | 2019-01-14 00:09:16 | 4,391
v_dwvdbprod1_node0004 | 2019-01-14 00:09:16 | 4,663
v_dwvdbprod1_node0005 | 2019-01-14 00:09:16 | 4,065
v_dwvdbprod1_node0006 | 2019-01-14 00:09:16 | 4,569
v_dwvdbprod1_node0007 | 2019-01-14 00:09:06 | 3,993
v_dwvdbprod1_node0008 | 2019-01-14 00:09:16 | 4,176
v_dwvdbprod1_node0009 | 2019-01-14 00:09:16 | 3,816
v_dwvdbprod1_node0010 | 2019-01-14 00:09:10 | 3,711
(10 rows)

Mon Jan 14 00:09:16 EST 2019
dwvdbprod1=> SELECT /+label(vBuddyLite)/ a.node_name, b.time, To_char( Sum(a.total_memory - a.free_memory) / 1024^2, '999,999,990') AS catalog_memory_MB
dwvdbprod1-> FROM dc_allocation_pool_statistics a
dwvdbprod1-> INNER JOIN (SELECT node_name, Date_trunc('SECOND', Max(time)) AS TIME
dwvdbprod1(> FROM dc_allocation_pool_statistics
dwvdbprod1(> GROUP BY 1) b
dwvdbprod1-> ON a.node_name = b.node_name
dwvdbprod1-> AND Date_trunc('SECOND', a.time) = b.time
dwvdbprod1-> GROUP BY 1, 2
dwvdbprod1-> ORDER BY node_name; !date
node_name | time | catalog_memory_MB
-----------------------+------------------------+-------------------
v_dwvdbprod1_node0001 | 2019-01-14 00:09:16-05 | 3,782
v_dwvdbprod1_node0002 | 2019-01-14 00:09:22-05 | 103,594
v_dwvdbprod1_node0003 | 2019-01-14 00:09:22-05 | 122,949
v_dwvdbprod1_node0004 | 2019-01-14 00:09:22-05 | 130,571
v_dwvdbprod1_node0005 | 2019-01-14 00:09:22-05 | 105,696
v_dwvdbprod1_node0006 | 2019-01-14 00:09:22-05 | 100,510
v_dwvdbprod1_node0007 | 2019-01-14 00:09:19-05 | 3,993
v_dwvdbprod1_node0008 | 2019-01-14 00:09:16-05 | 4,176
v_dwvdbprod1_node0009 | 2019-01-14 00:09:23-05 | 3,816
v_dwvdbprod1_node0010 | 2019-01-14 00:09:10-05 | 3,711
(10 rows)

5 replies

Jim_Knicely
Forum|alt.badge.img+2
  • Participating Frequently
  • January 14, 2019

Since those are DC tables maybe you don't have the same amount data in the dc_allocation_pool_statistics_by_second vs dc_allocation_pool_statistics?

What do see for minimum TIMEs in those tables?

SELECT node_name, MIN(time) FROM dc_allocation_pool_statistics_by_second GROUP BY 1 ORDER BY 1;

SELECT node_name, MIN(time) FROM dc_allocation_pool_statistics GROUP BY 1 ORDER BY 1;

Also, what is the METADATA pool reporting?

Example:

dbadmin=> SELECT current_value, description FROM configuration_parameters WHERE parameter_name = 'EnableMetadataMemoryTracking';
 current_value |                       description
---------------+----------------------------------------------------------
 1             | Track memory used by Vertica metadata in a resource pool
(1 row)


dbadmin=> SELECT node_name, memory_size_kb, memory_size_actual_kb
dbadmin->   FROM resource_pool_status
dbadmin-> WHERE pool_name = 'metadata';
    node_name     | memory_size_kb | memory_size_actual_kb
------------------+----------------+-----------------------
 v_vmart_node0001 |          94516 |                 94516
 v_vmart_node0002 |         191823 |                191823
 v_vmart_node0003 |         120851 |                120851
(3 rows)

Vertica_Curtis
Forum|alt.badge.img+1
  • Participating Frequently
  • January 14, 2019

This is the query I've always used to calculate catalog size.

\set fmt12 '\'999,999,999,999\''
select c.node_name,
to_char(c.SAL_total, :fmt12) as SAL_total,
to_char(c.SAL_free, :fmt12) as SAL_free,
to_char(c.Global_total, :fmt12) as Global_total,
to_char(c.Global_free, :fmt12) as Global_free,
to_char(c.SAL_total + c.Global_total, :fmt12) as Total,
to_char(c.SAL_free + c.Global_free, :fmt12) as Free,
to_char(c.SAL_total + c.Global_total -
c.SAL_free - c.Global_free, :fmt12) as Used
from (
select a.node_name,
max(decode(a.pool_name, 'Global', free_memory, NULL)) as Global_free,
max(decode(a.pool_name, 'Global', total_memory, NULL)) as Global_total,
max(decode(a.pool_name, 'SAL', free_memory, NULL)) as SAL_free,
max(decode(a.pool_name, 'SAL', total_memory, NULL)) as SAL_total
from (
select b.node_name, b.time, b.pool_name, b.total_memory, b.free_memory
from dc_allocation_pool_statistics b
join (select node_name, pool_name, max(time) as maxtime
from dc_allocation_pool_statistics
group by node_name, pool_name) as maxes
on (b.node_name=maxes.node_name and b.time=maxes.maxtime)
) a
group by a.node_name
) c
order by c.node_name ;

But like yours, it can sometimes return wildly skewed results from different nodes. I think some of the data doesn't always get purged from certain nodes right away, so it can linger for a while in that state.


Bryan_H
Forum|alt.badge.img+2
  • Author
  • Participating Frequently
  • January 15, 2019

OK, I'll have them try some of these other queries, but maybe we should update vBuddyLite to check metadata pool and vs_allocator_usage too?


Vertica_Curtis
Forum|alt.badge.img+1
  • Participating Frequently
  • April 11, 2019
SAL is local, and global is global. I don't know what SAL stands for.

Local catalog is everything unique to an individual node - ROS containers mostly.
Global is stuff that is on all the nodes, tables, users, schemas, etc.

Jim_Knicely
Forum|alt.badge.img+2
  • Participating Frequently
  • April 11, 2019

FYI...

SAL = Storage Abstraction Layer

Anyone remember SAL 9000 from 2010: The Year We Make Contact? She was HAL's twin appearing as a blue camera eye instead HAL's red one. :)