Sizing table and index range size

In order to use table and index stats you need to size the -tablerangesize and -indexrangesize parameters accordingly. There's a simple piece of code to work out what they should be. Many thanks to Rob Fitzpatrick for making this available. 

/* display the highest application object numbers in the current database */

/* this is the minimum acceptable value for -tablerangesize */
find last dictdb._file no-lock where _file._tbl-type = "T" use-index _file-number no-error.               

/* this is the minimum acceptable value for -indexrangesize */
find last dictdb._index no-lock where not _index._index-name begins "_" use-index _index-number no-error. 

display
  "Logical database   : " ldbname( "dictdb" )                      skip
  "Highest app table #: " _file._file-number format ">>>9"         skip
  "Highest app index #: " _index._idx-num    format ">>>9"         skip(1)
  "Note: these values are based on the assumption that -basetable" skip
  "      and -baseindex are both set to the default value of 1."
with no-box no-labels.

Copyright © 2018 James Palmer
GS RU