PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → Re: Does HFSQL release disk space upon Mass Data Deletion?
Re: Does HFSQL release disk space upon Mass Data Deletion?
Iniciado por guest, 07,jul. 2016 19:06 - 4 respuestas
Publicado el 07,julio 2016 - 19:06
Hi,

If a data file grows to 50gb and after deleting 40gb of data, does the physical size of the file reduce to reflect its true size.

Is this topic discussed in any of the documentation? I have not seen any...

MSSQL Server has issues with this as it does not want to release that space even with truncate after a defrag.

Thanks, Stanley
Publicado el 07,julio 2016 - 19:21
As farf as i know the spaces isn't reduced automaticly.

Check this help pages:
http://doc.windev.com/en-US/…
http://doc.windev.com/en-US/…
http://doc.windev.com/en-US/…
Publicado el 07,julio 2016 - 21:32
Hi

no it does not... Space will be reused automatically by new records, but if you want to give it back to the file system, you need to run a reindexation to do that

Best regards
Publicado el 08,julio 2016 - 07:36
Thanks Paulo and Fabrice!!

Stanley
Publicado el 08,julio 2016 - 17:12
Hi,

there is WDOptimizer ( http://help.windev.com/en-US/… ) for optimizing the index files and a lot more of fine-tuning a HFSQL file. WDOptimizer can be distributed together with your Wx application. WDOptimizer optimizes the internal structure of HFSQL files with the goal to optimize the access speed at run time.

Unfortunately, as you can deduct from the command line parameters of WDOptimizer ( http://help.windev.com/en-US/… ), optimizing access to a HFSQL file does not mean to compact the file to the utmost. This will slow down access times when adding new records.

There's even a function HAccelerateSpeed(...) in order to optimize the access speed to HFSQL files while running a Wx program!

If you really want to compact your file size then there's only one method: read the data sequentially from file A and insert it into a file B with the same structure. Depending on the file's structure, for a practical implementation there are two ways to go. a - simple: export the data into an ASCII / Unicode file, HCreation(...) of the original file and re-import the data. b - copy the files (HCopyFile(...) will do that for you on HFSQL C/S) of the original file to a file of a different name (e.g. CUSTOMER => CUSTOMERB), HCreation(...) the CUSTOMER file, then HDescribeFile / HDescribeItem file CUSTOMERB and its items, HOpen CUSTOMERB, read it sequentially and insert each record into file CUSTOMER. Maybe, the latter can be accomplished easier the HDeclare oder HDeclaerExternal but I do not have any experience with that. There may be even a method to compact a file using replication ..