Deleting data from GT.M

This is a discussion on Deleting data from GT.M within the mumps forums in Programming Languages category; Hi When I delete some data from database the is not smaller, after that when I do extract from database and delete database files and load that extract to that same database, then database files are smaller. is it the only way to have smaller database files after delete something from it? Regards Chaku...

Go Back   Application Development Forum > Programming Languages > mumps

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 12-13-2006, 10:29 AM
chaku
Guest
 
Default Deleting data from GT.M

Hi

When I delete some data from database the is not smaller, after that
when I do extract from database and delete database files and load that
extract to that same database, then database files are smaller. is it
the only way to have smaller database files after delete something from
it?


Regards
Chaku

Reply With Quote
  #2  
Old 12-13-2006, 10:40 AM
Denver
Guest
 
Default Re: Deleting data

chaku wrote:
> When I delete some data from database it is not smaller


This is very reasonable and completely harmless behavior.
There is no reason to be concerned about it.
Reply With Quote
  #3  
Old 12-14-2006, 03:16 AM
chaku
Guest
 
Default Re: Deleting data

It is reason, what happens when file grow up to disk limit? I think
this is not good idea to let this problem without solution.

Denver napisal(a):
> chaku wrote:
> > When I delete some data from database it is not smaller

>
> This is very reasonable and completely harmless behavior.
> There is no reason to be concerned about it.


Reply With Quote
  #4  
Old 12-14-2006, 04:00 AM
MikeW
Guest
 
Default Re: Deleting data


chaku wrote:
> It is reason, what happens when file grow up to disk limit? I think
> this is not good idea to let this problem without solution.
>
> Denver napisal(a):
> > chaku wrote:
> > > When I delete some data from database it is not smaller

> >
> > This is very reasonable and completely harmless behavior.
> > There is no reason to be concerned about it.


Mumps will re-use space released by deleting data before it attempts to
increase file size..

Bad idea to release disk space to OS when deleting data as the file
will become fragmented when it expands at a later date, always try to
create M data file at correct size & make sure no fragmentation for
optimum performance.

Mike

Reply With Quote
  #5  
Old 12-14-2006, 09:33 AM
K.S. Bhaskar
Guest
 
Default Re: Deleting data



On Dec 14, 4:00 am, "MikeW" <mike.woodw...@dbh.nhs.uk> wrote:
> chaku wrote:
> > It is reason, what happens when file grow up to disk limit? I think
> > this is not good idea to let this problem without solution.


[KSB] In a production environment, I hope you will check disk usage so
that you detect when you are likely to run out of disk space long
before it happems. In a development environment, where a software bug
may cause a database to grow, you can set the automatic extension to
zero. GT.M will issue errors (refer to the documentation) when it is
not able to extend a file because it is out of space or because the
file system is out of space.

> > Denver napisal(a):
> > > chaku wrote:
> > > > When I delete some data from database it is not smaller

>
> > > This is very reasonable and completely harmless behavior.
> > > There is no reason to be concerned about it.Mumps will re-use space released by deleting data before it attempts to

> increase file size..
>
> Bad idea to release disk space to OS when deleting data as the file
> will become fragmented when it expands at a later date, always try to
> create M data file at correct size & make sure no fragmentation for
> optimum performance.


[KSB] This is good advice. In any case, GT.M does not release space
from a database file. You can use mupip reorg to compact the data
within the file while an application is in use, but GT.M will not
release unused space from the file back to the operating system.

Regards
-- Bhaskar
ks dot bhaskar at fnf dot com <-- send e-mail here

Reply With Quote
  #6  
Old 12-20-2006, 09:27 AM
Greg Woodhouse
Guest
 
Default Re: Deleting data from GT.M


chaku wrote:
> Hi
>
> When I delete some data from database the is not smaller, after that
> when I do extract from database and delete database files and load that
> extract to that same database, then database files are smaller. is it
> the only way to have smaller database files after delete something from
> it?
>
>
> Regards
> Chaku


Try thinking about how you'd go about implenting a database from
scratch. You could store all the data in a big array, of course, but
you wouldn't want to have to re-copy the whole databasse (or most of
it) to fill in "holes". Of course, you don't want to insert data at
random, because then searching for it could take a very long time. You
also don't want to allocate data storage in arbitrary sized chunks
because the blocks of data need to align in some reasonable way. So,
you've got a few things going on here: You might be adding and deleting
data from a single block, or the system may be just marking a block
free, so that there is room for other contiguous pieces of data to
grow. These are both issues that arise with ordinary file systems, too.
What makes databases interesting is that you need to allow essentially
unbounded "room to grow", and you need to keep access time under
control, so it dends up being a kind of balanced tree structure. If you
know about red-black trees or one of their cousins, then you have the
basic idea. But BINARY trees are inappropriate for a couple of reasons:
Search time can still be long if the branching factor is only 2, and
you don't want to allocate storage in units of only a few bytes, so you
instead, you end up uing similar data structure with bigger blocks and
a larger branching factor known as a B-tree.

Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 07:13 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.