Question
· Jul 12, 2018

^%GSIZE Output showing only last page

How best can I capture %GSIZE all pages? Or parameters to use?

The output file is only showing the last page.

 

I used these options

Device: /usr/cache/mgr/gsizedoc.txt

Parameters? "WNS" =>

 

--------------------------

Page: 23                          GLOBAL SIZE                                                                            12 Jul 2018
                                                                                                                             3:56 PM
      Global        Blocks       Bytes Used  Packing   Contig.
      --------    --------  ---------------  -------   -------
      rINDEXSQL                           0      0 %         0
      rMAC                               12      0 %         0
      rMACSAVE                           16      0 %         0
      rMAP                               12      0 %         0
      rOBJ                              320      4 %         0
      tmpOut                            472      6 %         0
      waJobs                             56      1 %         0
      waLogArr                          476      6 %         0

 

---------------------------------------------------------------------------------------

%SYS>w $ZV

Cache for UNIX (Red Hat Enterprise Linux 5 for x86-64) 2010.2.3 (Build 702) Tue

Feb 15 2011 14:21:10 EST

%SYS>

Discussion (5)3
Log in or sign up to continue

If you prefer to code global size calculation by yourself rather than amend ^%GSIZE, the feasible option is to call

set bSize=$$AllocatedSize^%GSIZE(global)

which returns size in bytes for a global mapped to the current namespace. It recognizes the database the global is mapped from, so you don't need to do it yourself. The only thing you need is a global list for the namespace, which can be fetched in several ways, e.g. using $Order(^$G(global)). It can be used on per database basis as well. Pros of this approach:
- speed, as it neither runs query nor instantiates %SYS.GlobalQuery objects;
- AFAIR, there was an error in global size calculation with %SYS.GlobalQuery::Size() query in old Caché versions, up to 2015.1;
- starting from 2015.1, it can be used with subglobals.

Cons:
- this $$-function is not documented;
- not sure if it existed in 2010.1.