RE: compressing tables
Posted in 1995
You can estimate the number of deleted rows using storage space. Informix SE (it least 5.0) stores rows as a string of bytes terminated by a newline (\\n). You may estimate your required storage by multiplying your rows size + 1 times the number of rows in the table. You then round up to the next full page size. Example: Row size 500 bytes Rows 100 (500 +1) * 100 = 50100 50100 / 1024(Use your machine Page size) = 48.92 49 pages * 1024 = 50176 bytes After estimating the required storage bytes subtract it from the current table storage bytes. Then divide the difference by the row size +1. Example: Current table size 80896 - 50176 = 30720 30720 / (500 +1) = 61.317 You would have about 61 deleted rows. The answers about how to release the space being used by deleted rows are all good. I most like the building of a clustered index because its the easiest. One note: Informix SE after release 1.0 does reuse the storage space of deleted rows. Last row deleted is the first over written. ---------- From: ilist To: internet!rmy.emory.edu!informix-list Subject: compressing tables Date: Wednesday, March 08, 1995 10:05PM I have several very large tables that I would like to shrink (delete the rows that have already been "marked" for deletion"). First of all, is there a way to tell how many of these blank rows exist in a table. Also, are there any tools to shrink tables, rather than modifying it, then changing it back to it's original form? This is for the standard engine.... -- ----------------------- J.E. "Rock" Solomon Jr. jesolom@PacBell.COM (510) 867-6615