Monday, July 2, 2007

From the Edge: Pack Keys Versus Pack Index
Section: Commands
Chapter: Running R:BASE Your Way!
Platform: R:BASE 7.5, R:BASE 7.6 and Turbo V-8 for Windows

Disk space becomes unusable when you delete table rows or indexes, delete columns or tables, or add or modify columns with the ALTER TABLE command. The PACK command
can be used to recover this disk space.

To use the PACK command, you must be connected to the database. If the database you want to pack is not in the current directory, include the complete path and database name in the PACK command. When you pack a database that is in a different directory, R:BASE disconnects any opened database, then makes a connection to the specified database you want to pack. And, to PACK a database you are required to
be connected with the OWNER identifier, if the database is password protected.

Different options are available to you based on whether the database will be
connected in single-user or multi-user mode.

These PACK command parameters are available in Single-User Mode ONLY (MULTI OFF):

. PACK SCHEMA
. PACK KEYS
. PACK ALL
. PACK ALL WITH USER CASE

These PACK command parameters are available in both Single-User and Multi-User Mode:

. PACK PASSWORD
. PACK TABLE <tablename>
. PACK INDEX
. PACK INDEX <indexname>
. PACK INDEX FOR <tablename>

Because of these connection-based distinctions, the database file sizes will be
effected differently when the parameters are used.

If any of the single-user mode specific parameters are used, the database files
will decrease in size as the files are rebuilt.

If any of the multi-user mode specific parameters are used, the database files
will increase in size varying on parameters used. The file increase occurs
because as R:BASE performs the PACK operation, the original table and/or index
is being reloaded to the end of the file to not disrupt any other users already
connected.

So, in a PACK KEYS versus PACK INDEX comparison a PACK INDEX performed upon a
database with a .RB3 index file with a size of 5,412 kilobytes will result in a file increase to 10,824 kilobytes. When you perform a PACK KEYS, the .RB3 index
file will decrease back to 5,412 kilobytes.

You may also refer to the following articles:

Indexing Explained                                              06/20/2007
Database Maintenance (R:BASE Turbo V-8 for Windows)             05/15/2007
Database Maintenance (R:BASE 7.6 for Windows)                   05/14/2007
R:BASE Database Maintenance Using New SET RECYCLE Setting       02/24/2006
R:BASE Table Maintenance Using Enhanced AUTOCHK Command         02/22/2006
BACKUP, UNLOAD, and PACK vs. RELOAD                             01/15/1999

A PDF version of this article is also available at:

From The Edge: http://www.razzak.com/fte/

Very Best R:egards,

Razzak.

--- RBASE-L
================================================
TO POST A MESSAGE TO ALL MEMBERS:
Send a plain text email to [email protected]

(Don't use any of these words as your Subject:
INTRO, SUBSCRIBE, UNSUBSCRIBE, SEARCH,
REMOVE, SUSPEND, RESUME, DIGEST, RESEND, HELP)
================================================
TO SEE MESSAGE POSTING GUIDELINES:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: INTRO
================================================
TO UNSUBSCRIBE: Send a plain text email to [email protected]
In the message SUBJECT, put just one word: UNSUBSCRIBE
================================================
TO SEARCH ARCHIVES:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: SEARCH-n
(where n is the number of days). In the message body, place any text to search for.
================================================

Reply via email to