Why is temporary database reported smaller than actual size of the disk ?
I have notified that on several servers the IRISTEMP database is reported as only a few GB in size while on the disk where it's located, the IRIS.DAT file is much bigger (eg: 3GB reported in Portal (including free space) while file on the disk file is 121GB). The last modification date of IRIS.DAT is recent so I'm not looking into a location no more in use.
Is there an explanation for that difference in size ?
I know temporary databases are special in a way they are not always stored on the disk, here is what InterSystems says about it :
Changes to temporary globals are not written to disk. Instead the changes are maintained within the in-memory buffer pool. A large temporary global may be written to disk if there is not sufficient space for it within the buffer pool.
Still it does not explain the size difference between portal and physical disk.
Also : I saw that this database get expanded multiple times, sometimes 20 times in 2 seconds (eg : 30, 33, 37 ... until 1000MB). Would it make sense to change expansion size to something else than default ? (eg: 300MB).
Comments
Display Free Space Information Using the Management Portal
Size The current allocated size of the database, in megabytes. Note: This field measures the logical size of the database. As a result, the size reported here may be lower than the physical size of the database, in particular for the IRISTEMP database.
Look at MaxIRISTempSizeAtStart
Do you think it make sense to set a expansion size to something else than default (eg: 300MB), especially knowing TEMP database in my case end up being 5GB at the end of everyday (thus requiring many expansions through the day) ?
Yes. Or you can immediately increase the logical size of the IRISTEMP to the desired value, for example:
%SYS>set status=##class(Config.Databases).Get("IRISTEMP",.props)
%SYS>set status=##class(SYS.Database).ModifyDatabase(props("Directory"),5*1024) ; 5Gb
In this case, you will immediately increase the size from 240Mb to 5Gb, bypassing many small expansions.
again YES !
Any expansion is related to an extension of the internal mapping structure of the .DAT file
written to disk If you don't have any restrictions on disk space, you consume the related
overhead in 1 single shot at a time that you control (e.g., startup)