Truncate Database

29 views
Skip to first unread message

Mojtaba Hajivandian

unread,
Oct 4, 2013, 7:04:05 AM10/4/13
to brightsta...@googlegroups.com
How can i truncate BrightstarDB ?

Khalil Ahmed

unread,
Oct 4, 2013, 7:20:52 AM10/4/13
to brightsta...@googlegroups.com
Hi,

I'm not sure what you mean by truncate.

If you want to compress the database to remove pages that are no longer in use, then you can do this from code using the ConsolidateStore method (http://brightstardb.readthedocs.org/en/latest/Admin_API/#consolidating-the-store). 

If you want to revert the store to its initial (empty) state then you can use the revert API to revert to the very first commit point (see http://brightstardb.readthedocs.org/en/latest/Admin_API/#reverting-the-store) - though this just moves a copy of the first commit point up to the top of the commit stack, so your database size remains the same. You could revert and then consolidate the store to get back to an empty store.

Of course if you just want to empty the store completely you could just delete the store and create a new store with the same name. If you do this, be warned that sometimes the file APIs seem to take a while to catch up to the fact that a directory has been destroyed so you may need a delay between deleting the store and re-creating it (I've tried to mitigate this in the delete code, but it doesn't always work properly for some reason).

Cheers

Kal


On Fri, Oct 4, 2013 at 12:04 PM, Mojtaba Hajivandian <hajiv...@gmail.com> wrote:
How can i truncate BrightstarDB ?

--
You received this message because you are subscribed to the Google Groups "BrightstarDB Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brightstardb-us...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Kal Ahmed
Director, Networked Planet Limited
e: kal....@networkedplanet.com
w: www.networkedplanet.com

Mojtaba Hajivandian

unread,
Oct 4, 2013, 7:52:59 AM10/4/13
to brightsta...@googlegroups.com
My purpose was to compress database size and remove history points.
I use ConsolidateStore API but, don't any change my database size!
Where is problem ?

Thanks Khalil Ahmed.

On Friday, October 4, 2013 2:50:52 PM UTC+3:30, Khalil Ahmed wrote:
Hi,

I'm not sure what you mean by truncate.

If you want to compress the database to remove pages that are no longer in use, then you can do this from code using the ConsolidateStore method (http://brightstardb.readthedocs.org/en/latest/Admin_API/#consolidating-the-store). 

If you want to revert the store to its initial (empty) state then you can use the revert API to revert to the very first commit point (see http://brightstardb.readthedocs.org/en/latest/Admin_API/#reverting-the-store) - though this just moves a copy of the first commit point up to the top of the commit stack, so your database size remains the same. You could revert and then consolidate the store to get back to an empty store.

Of course if you just want to empty the store completely you could just delete the store and create a new store with the same name. If you do this, be warned that sometimes the file APIs seem to take a while to catch up to the fact that a directory has been destroyed so you may need a delay between deleting the store and re-creating it (I've tried to mitigate this in the delete code, but it doesn't always work properly for some reason).

Cheers

Kal
On Fri, Oct 4, 2013 at 12:04 PM, Mojtaba Hajivandian <hajiv...@gmail.com> wrote:
How can i truncate BrightstarDB ?

--
You received this message because you are subscribed to the Google Groups "BrightstarDB Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brightstardb-users+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
Reply all
Reply to author
Forward
0 new messages