You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by Adam Bovill <ab...@fnfr.com> on 2007/04/25 22:16:09 UTC
Calculating Database Size
Hello,
I was wondering whether there was a good way to calculate the amount of
space that my derby database is currently using.
In the application that I'm working on, I have to keep that last X
megabytes of data (where X is a user definable value). The overriding
table of information is the items table that has two CLOBs in it:
Items {
ID
.
.
CLOB
CLOB
}
Is there a way to query derby to find out how much space it is using so
that I can delete some items and then "reclaim" the space with:
call SYSCS_UTIL.SYSCS_COMPRESS_TABLE('APP', 'ITEMS', 0);
or
SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE(
IN SCHEMANAME VARCHAR(128),
IN TABLENAME VARCHAR(128),
IN PURGE_ROWS SMALLINT,
IN DEFRAGMENT_ROWS SMALLINT,
IN TRUNCATE_END SMALLINT )
The documentation states: Unlike SYSCS_UTIL.SYSCS_COMPRESS_TABLE(), all
work is done in place in the existing table/index.
Does that mean that the first call creates a new set of files and copies
itself over there and when that is complete, the old files are deleted?
Or is the only way to do this to add a "SUM" column to that table and
then perform the following query:
SELECT SUM(size) FROM Items;
And then delete appropriately?
(Sorry if this is answered somewhere, I searched through the
documentation for everything that I could think of.)
Thanks,
Adam
Re: Calculating Database Size
Posted by John Embretsen <Jo...@Sun.COM>.
Bryan Pendleton wrote:
>> I was wondering whether there was a good way to calculate the amount
>> of space that my derby database is currently using.
>
> There is org.apache.derby.diag.SpaceTable.
I noticed a Java app attached to
https://issues.apache.org/jira/browse/DERBY-2549 (DerbyDiskSpaceDiag.java) which
may be helpful too.
--
John
Re: No more IBM support after Sept 2008?
Posted by Dan Scott <de...@gmail.com>.
How about the authoritative source?
http://www-1.ibm.com/support/docview.wss?rs=636&uid=swg21256502
It probably doesn't make much sense for IBM to continue support of
something (Cloudscape, aka Derby) that is now a base part of the Java
environment (JavaDB, aka Derby). And, as noted, they will still
contribute to the development of Apache Derby.
Dan
On 28/04/07, Raymond Kroeker <ra...@raykroeker.com> wrote:
> http://www.canada.com/nationalpost/financialpost/story.html?id=838b3819-7e60-44ad-986a-76569847e2e4&k=25741
> http://www-1.ibm.com/support/docview.wss?rs=636&uid=swg21256502
>
>
>
> On 4/28/07, Tony Winslow <to...@gmail.com> wrote:
> > Can you provide the source of the info?Any href?
> >
> >
> > 2007/4/26, derby@segel.com < derby@segel.com>:
> > > In another IBM/MySQL announcement, it mentioned that IBM is getting out
> of
> > > the support game for Cloudscape aka Derby.
> > >
> > > Kind of interesting.....
> > >
> > >
> > >
> > >
> >
> >
>
>
>
> --
> ---------------------------------------------------------
> Raymond Kroeker
--
Dan Scott
Laurentian University
Re: No more IBM support after Sept 2008?
Posted by Raymond Kroeker <ra...@raykroeker.com>.
http://www.canada.com/nationalpost/financialpost/story.html?id=838b3819-7e60-44ad-986a-76569847e2e4&k=25741
http://www-1.ibm.com/support/docview.wss?rs=636&uid=swg21256502
On 4/28/07, Tony Winslow <to...@gmail.com> wrote:
>
> Can you provide the source of the info?Any href?
>
> 2007/4/26, derby@segel.com <de...@segel.com>:
> >
> > In another IBM/MySQL announcement, it mentioned that IBM is getting out
> > of
> > the support game for Cloudscape aka Derby.
> >
> > Kind of interesting.....
> >
> >
> >
> >
>
--
---------------------------------------------------------
Raymond Kroeker
Re: No more IBM support after Sept 2008?
Posted by Tony Winslow <to...@gmail.com>.
Can you provide the source of the info?Any href?
2007/4/26, derby@segel.com <de...@segel.com>:
>
> In another IBM/MySQL announcement, it mentioned that IBM is getting out of
> the support game for Cloudscape aka Derby.
>
> Kind of interesting.....
>
>
>
>
No more IBM support after Sept 2008?
Posted by de...@segel.com.
In another IBM/MySQL announcement, it mentioned that IBM is getting out of
the support game for Cloudscape aka Derby.
Kind of interesting.....
RE: Calculating Database Size
Posted by Adam Bovill <ab...@fnfr.com>.
Thanks Bryan.
And thanks for the link to nabble. It is great for searching this list.
I think that I might just have a size field that I do a sum on, that way
I get a more precise idea of the space used.
Thanks again,
-Adam
-----Original Message-----
From: Bryan Pendleton [mailto:bpendleton@amberpoint.com]
Sent: Wednesday, April 25, 2007 1:32 PM
To: Derby Discussion
Subject: Re: Calculating Database Size
> I was wondering whether there was a good way to calculate the amount
of
> space that my derby database is currently using.
There is org.apache.derby.diag.SpaceTable.
This should give you some pointers about how to use it:
http://www.nabble.com/Re%3A-How-do-I-tell-whether-a-table-has-unused-spa
ce-or-not--p3635750.html
thanks,
bryan
Re: Calculating Database Size
Posted by Bryan Pendleton <bp...@amberpoint.com>.
> I was wondering whether there was a good way to calculate the amount of
> space that my derby database is currently using.
There is org.apache.derby.diag.SpaceTable.
This should give you some pointers about how to use it:
http://www.nabble.com/Re%3A-How-do-I-tell-whether-a-table-has-unused-space-or-not--p3635750.html
thanks,
bryan