Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Guides   Examples
New in version: 7.3   7.4   7.5   8.0   8.1   8.2   8.3   8.4   8.5   8.6    Statistic  

FM.TableStatistics

Queries statistics on a table.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
FM 8.2 Yes Yes Yes Yes Yes
MBS( "FM.TableStatistics"; FileName; TableName )   More

Parameters

Parameter Description Example value
FileName The target database name.
Can be empty to not limit query to one database.
""
TableName The name of the table to check. "Contacts"

Result

Returns OK or error.

Description

Queries statistics on a table.
The plugin will walk over all records and count fields with various data types and how many empty fields are there.
We sum up the length of all text in text fields as well as the text content of all fields.
We sum up the size of all internal containers, so ContainerByteSize + AllTextLengths*2 plus some metadata is the size of the database file.
For internal containers we also count the streams inside, so you know how many JPEGs and other file types are in the table.

e.g.
{
"FileName":"",
"TableName":"Contacts",
"RecordCount":4,
"MinRowID":1,
"MaxRowID":4,
"ColumnCount":35,
"CountText":20,
"CountEmpty":107,
"CountNumber":5,
"CountDate":2,
"CountTime":1,
"CountTimestamp":1,
"CountContainer":4,
"CountExternalContainer":1,
"ContainerByteSize":1162565,
"TextLengths":132,
"AllTextLengths":365,
"CountDPI_":2,
"SizeDPI_":8,
"CountFNAM":3,
"SizeFNAM":90,
"CountSIZE":2,
"SizeSIZE":8,
"CountPNGf":1,
"SizePNGf":727569,
"CountFILE":1,
"SizeFILE":390,
"CountJPEG":1,
"SizeJPEG":434606
}

This function can take a long time for huge tables with millions of records. 64-bit FileMaker version recommended for better memory handling.

KeyValue
FileNameThe file name for the table.
TableNameThe table name for this statistics.
RecordCountThe number of records.
MinRowIDThe smallest record ID.
MaxRowIDThe biggest record ID.
ColumnCountNumber of columns.
CountTextNumber of fields containing text.
CountEmptyNumber of fields being empty.
CountNumberNumber of fields containing numeric values.
CountDateNumber of fields containing dates.
CountTimeNumber of fields containing times.
CountTimestampNumber of fields containing time stamps.
CountContainerNumber of all fields containing containers (includes CountExternalContainer).
CountExternalContainerNumber of fields containing external containers.
TextLengthsLength of text in text fields only.
AllTextLengthsLength of all text in all fields seen including numbers, times, dates, timestamps and containers read as text.
CountDPI_Count of containers with DPI information.
SizeDPI_Size of all DPI informations in containers.
CountFNAMCount of containers with file name information.
SizeFNAMSize of all filename informations in containers.
CountSIZECount of containers with image dimension information.
SizeSIZESize of all image dimension informations in containers.
CountMAINCount of all main item informations in containers.
SizeMAINSize of all main item informations in containers.
CountTIFFCount of all TIFF images in containers.
SizeTIFFSize of all TIFF images in containers.
CountPDF Count of all PDF documents in containers.
SizePDF Size of all PDF documents in containers.
CountPNGfCount of all PNG images in containers.
SizePNGfSize of all PNG images in containers.
CountGIFfCount of all GIF images in containers.
SizeGIFfSize of all GIF images in containers.
CountBMPfCount of all BMP images in containers.
SizeBMPfSize of all BMP images in containers.
CountEPS Count of all PostScript documents in containers.
SizeEPS Size of all PostScript documents in containers.
CountPICTCount of all PICT images in containers.
SizePICTSize of all PICT images in containers.
CountM4V Count of all MPEG4 videos in containers.
SizeM4V Size of all MPEG4 videos in containers.
CountWAV Count of all Windows audio sounds in containers.
SizeWAV Size of all Windows audio sounds in containers.
CountM4A Count of all MEPG 4 sounds in containers.
SizeM4A Size of all MEPG 4 sounds in containers.
CountMOV Count of all QuickTime movies in containers.
SizeMOV Size of all QuickTime movies in containers.
CountAVI Count of all Windows movies in containers.
SizeAVI Size of all Windows movies in containers.
CountAU Count of all Unix sounds in containers.
SizeAU Size of all Unix sounds in containers.
CountMP3 Count of all MP3 sounds in containers.
SizeMP3 Size of all MP3 sounds in containers.
CountMPEGCount of all MPEG movies in containers.
SizeMPEGSize of all MPEG movies in containers.
CountMPG4Count of all MPEG 4 movies in containers.
SizeMPG4Size of all MPEG 4 movies in containers.
CountAIFFCount of all AIFF sounds in containers.
SizeAIFFSize of all AIFF sounds in containers.
Count8BPSCount of all Photoshop images in containers.
Size8BPSSize of all Photoshop images in containers.
CountMETACount of all WMF images in containers.
SizeMETASize of all WMF images in containers.
CountFILECount of all raw file data in containers.
SizeFILESize of all raw file data in containers.
CountJPEGCount of all JPEG images in containers.
SizeJPEGSize of all JPEG images in containers.
CountFORKCount of all MacOS resource fork information in containers.
SizeFORKSize of all MacOS resource fork information in containers.
CountZLIBCount of all compressed data in containers.
SizeZLIBSize of all compressed data in containers.
TotalSizeSize of all internal containers together.

Examples

Check statistics:

MBS( "FM.TableStatistics"; "Contacts.fmp12"; "Contacts" )

Blog Entries

Created 26th April 2018, last changed 17th December 2018


FM.StopScriptIdle   -   FM.UpdateRecord

Feedback: Report problem or ask question.




Links
MBS Xojo Plugins