File
hstore_compact.rb
Home
Path: hstore_compact.rb
Modified: Fri Oct 17 11:15:28 GMT-7:00 2003

hstore_compact.rb hstore_name

This removes all free space (unused file space) from the HStore. Stores the original HStore files in ./hstore_backup by default.

  Examples:
     ruby hstore_compact.rb hstore_name description version
     cd ../tst
     ruby -r locana.rb ../hstore/hstore_compact.rb locana.ls "Locana Objects" "1.00"
     cd ../applets
     ruby -r notes.rb ../hstore/hstore_compact.rb notes.hs "Locana Notes" "1.00"
     ruby -r reminders.rb ../hstore/hstore_compact.rb reminders.hs "Locana Reminders" "1.00"
     ruby -r todos.rb ../hstore/hstore_compact.rb todos.hs "Locana Todos" "1.00"
     ruby -r timer.rb ../hstore/hstore_compact.rb timer.hs "Locana Timer Data" "1.00"
     # the -r is needed so backup_store knows what to do with the internal data stored in each HStore.

  To see the contents of the HStores:
     cd ../tst
     ruby -r locana.rb ../hstore/hstore_dump.rb locana.ls
     cd ../applets
     ruby -r notes.rb ../hstore/hstore_dump.rb notes.hs
     ruby -r reminders.rb ../hstore/hstore_dump.rb reminders.hs
     ruby -r todos.rb ../hstore/hstore_dump.rb todos.hs
     ruby -r timer.rb ../hstore/hstore_dump.rb timer.hs
Required files

HStore
Methods

compact,
Public Instance methods
compact(hstore_name, backup_dir, descriptor=nil) src

This eliminates all free space from the HStore and/or allows you to change the description and version stored in the descriptor. Call this method (or tst_hstore_compact.rb) when the HStore gets too bloated with free space. If this fails, the original files should remain in the current, unchanged state.

This exports the HStore, creates a new HStore, imports from the exported file, and if everything works correctly renames the new HStore to the old name. Descriptor is a Hash. If you provide a descriptor, it will replace the old descriptor.

Returns export_filename, export_record_count, import_record_count, error_count


Seva Software


Thank you for taking the time to visit this web page. I trust you found the information contained in this page useful.
Please email any questions, concerns, or issues with this web site to webmaster@sevasoftware.com.
Please remember Seva Software when your company would benefit from an experienced database architect and software engineer.

http://www.arunadb.org http://www.locana.org http://www.ruby-lang.org http://www.coolwell.org http://www.sevasoftware.com